My client is too lazy or I say too dumb to write or copy paste meta description / introtext for seo.
He just want to write on content area. That’s it.
So im figuring out how to auto generate these tags for seo purpose and blog’s intro excerpt ?
Currently Im doing this but getting full content or if i modift tag then i get nothing.
I am doing something wrong but im unable to catch! Also please tell me how to strip words length.
Please also add htmlent as well as you otherwise risk breaking the entire page if the user enters double quotes.
And in the context of rendering a description for the current page (rather than a page being iterated over by get/pdoResources), you need to use * instead of + in the tags.
This example uses the full description, or the first 50 chars of the content, and encodes it with htmlent:
As you mentioned it was for seo purposes I’d assumed the meta tag in the header, in which case you need to use * to get it for the current resource.
However, when listing child resources you need to use +. Resource fields vs placeholders.
For pdoResources to make [[+content]] available, you also need to add &includeContent=`1` to the snippet call. That’s ignored for performance reasons otherwise.
This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.