Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
xtech Posted December 17, 2015 Posted December 17, 2015 Hi, i have an IP Pages creating a forum topic for each article, for comments. The thing is, IP pages also puts the whole content of the article into the topic. As google may complain about the duplicate content, i would like to know if it could put just a "teaser" of the article instead of the whole text and how can i do this. I suppose i have to edit any file, but i don't know which one. May somebody help me?
opentype Posted December 17, 2015 Posted December 17, 2015 Haven’t used this myself, but apparently if you activate the Post to Forum option on the database level, then the field settings get a new option where you define there if and how the specific field is posted to the forum topic.
openfire Posted December 17, 2015 Posted December 17, 2015 6 hours ago, xtech said: Thank you! Solved! Where is the setting for this?
xtech Posted December 17, 2015 Author Posted December 17, 2015 In the fields of the database you've enabled to post on forum.
openfire Posted December 17, 2015 Posted December 17, 2015 14 minutes ago, xtech said: In the fields of the database you've enabled to post on forum. Is this what you mean?
openfire Posted December 17, 2015 Posted December 17, 2015 Ah, ok! Now one more question... what did you put in that box to get just a teaser?
xtech Posted December 17, 2015 Author Posted December 17, 2015 You have several ways. The easiest and less cpu intensive is to create a "teaser" field and showing it instead of the whole content (that's what i did). The other one is to trim it in realtime using JS or PHP.
openfire Posted December 17, 2015 Posted December 17, 2015 29 minutes ago, xtech said: You have several ways. The easiest and less cpu intensive is to create a "teaser" field and showing it instead of the whole content (that's what i did). The other one is to trim it in realtime using JS or PHP. I didn't see an option for field type: "teaser" in the field settings, so I did some searching and found out that a teaser field is just a text area. https://community.invisionpower.com/topic/405376-pages-question-regarding-fields/?do=findComment&comment=2523110 So I tried using field type "text area", but it is still showing the full article in the topic.Am I missing a setting somewhere?
chilihead Posted December 17, 2015 Posted December 17, 2015 They really need to offer truncating otherwise you have to remove the entire article body.
opentype Posted December 17, 2015 Posted December 17, 2015 26 minutes ago, openfire said: So I tried using field type "text area", but it is still showing the full article in the topic.Am I missing a setting somewhere? You need to activate the new teaser field for the post, and DEACTIVATE the regular content field with the full article.
openfire Posted December 17, 2015 Posted December 17, 2015 44 minutes ago, opentype said: You need to activate the new teaser field for the post, and DEACTIVATE the regular content field with the full article. Thanks opentype. Where can I deactivate the regular content field with the full article? I'm not seeing the option...
opentype Posted December 17, 2015 Posted December 17, 2015 2 minutes ago, openfire said: Thanks opentype. Where can I deactivate the regular content field with the full article? I'm not seeing the option... You empty the Topic Format box for this field.
openfire Posted December 17, 2015 Posted December 17, 2015 So that leaves just a link back to the article, with no excerpt of the article, correct?
xtech Posted December 17, 2015 Author Posted December 17, 2015 1 hour ago, openfire said: I didn't see an option for field type: "teaser" in the field settings, so I did some searching and found out that a teaser field is just a text area. Exactly. It's just a text area or text. You then insert there what you want. I ususally paste one of the content paragraphs there. Quote https://community.invisionpower.com/topic/405376-pages-question-regarding-fields/?do=findComment&comment=2523110 So I tried using field type "text area", but it is still showing the full article in the topic.Am I missing a setting somewhere? Yes, you need to de-activate the content field. Remove the {$value} variable on the content field. Ad {$value} on the teaser field. Edit: I've seen that opentype has already answered!
openfire Posted December 17, 2015 Posted December 17, 2015 Ahhhhh OK. I see what I was doing wrong. What this does is allow you to enter your teaser text manually when you are adding the article, in addition to your article content. All this time, I thought the teaser text was supposed to be generated automatically. Got it now. Long day. Thanks for the help guys!
xtech Posted December 17, 2015 Author Posted December 17, 2015 You can generate it automatically... but you have to trim the variable in php (or JS). Instead of {$value} in the content field you can put something like (this is the php version): {{$trimmedValue = substr($value, 0, 160); /*If you want the first 160 characters*/ }} {$trimmedValue} Be careful with this: you should strip the html tags first. And you sentences or words can be cut with this simple approach. If you really want this, you have to perform more checks and refinements.
openfire Posted December 17, 2015 Posted December 17, 2015 Thanks xtech. I'll play around with that and see if I can get it to work.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.