Gazley Posted July 6, 2013 Share Posted July 6, 2013 Hi there, I just wondered what other users are doing in the following scenario. I use the summary field to contain hold text that I use as the meta description in search engines. If the field is empty, I would like to select the first 'n' characters of the body field so that at least something is being used for the meta description. There are numerous ways to do this in PHP. I recall that ExpressionEngine had a first party add-on that did something similar to this and also added '...' to the end of the string too, so that you could use existing copy as a summary in other places, like, the home page. Before I re-invent the wheel, I thought I would ask whether there is a standard PW approach or some handy-dandy class you could recommend? Thanks! --Gary Link to comment Share on other sites More sharing options...
Soma Posted July 6, 2013 Share Posted July 6, 2013 I'm sure there's more and other ways but look here http://processwire.com/talk/topic/3429-how-to-set-text-linecharacter-limits-in-templates/ 1 Link to comment Share on other sites More sharing options...
Gazley Posted July 6, 2013 Author Share Posted July 6, 2013 Thanks Soma - some interesting stuff there and definately along the lines I was looking for. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now