548 Posts
joomleb
9 years ago
7
Topic
Hi guys, 
I'm looking to add articles from frontend,
I want to add just the fulltext content and then, when I submit the article, auto populate the Introtext content with with the first 20 words of the fulltext content followed by "[...]" sign.
Please, Do you have any suggestions on doing it ?
Get a Book for SEBLOD
4229 Posts
Kadministrator
9 years ago
2
Level 1
There is no built in function for this, you will need to use code pack, I think onBeforeStore should work for this and fill introtext with substring on fulltext
548 Posts
joomleb
9 years ago
1
Level 2
Hi Klas, 
thank you very much for suggestion. 
Please, Do you have any suggestion on PHP code to use for fill introtext with substring on fulltext ?
4229 Posts
Kadministrator
9 years ago
0
Level 3
Hi,

there is a code example on how to set fields values and typo at http://www.seblod.com/products/1854 , you can access other fields in the same way.
97 Posts
Anjo
9 years ago
1
Level 1
Hi,
This would be a very useful feature for me as well. The problem is I can't code but if someone knows how to do this and can post an example of the code it would really help me out understand how to write code for onBeforeStore plugin.

Thanks
Claudio

693 Posts
rpoy
9 years ago
0
Level 2
Hi,

As Klass mentioned, the example on how to set the field is in the description.  For the logic, a good example here.  If you need further assistance Octopoos can help.

thanks,

Randy
97 Posts
Anjo
9 years ago
0
Level 1
Hi thanks for the links.
I have been thinking that possibly the easiest way to do this is by not using fulltext and use introtext only for the all the text, then use PHP String plugin to only show the first 20 words of the text.
548 Posts
joomleb
9 years ago
0
Level 1

Hi guys, 

a different approach can be: have both fields on frontend (introtext content and fulltext content), but some rules are needed, please:

  1. How to set a maximum letters can be entered for each content field ?
  2. Is there a way to show in article view the introtext content and fulltext content consequential not one above and the other below, like:

introtext content bla bla fulltext content bla bla

Not

introtext content bla bla

fulltext content bla bla

Get a VIP membership