|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
solanrume Smarty n00b
Joined: 28 Jul 2019 Posts: 1
|
Posted: Sun Jul 28, 2019 10:10 am Post subject: How to create "Read more" button |
|
|
Hi everybody, I'm newbie. I want to create "Read more" button , it displays 45 characters and then expands when you click the 'Read more' button. Can you give me some suggestions? |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Wed Jul 31, 2019 11:28 am Post subject: |
|
|
Smarty don't control any buttons. By the time your code is displayed in the Browser, Smarty had already finished its work and is long gone already.
What you will need is CSS "overflow" attribute, and some JavaScript automation to drive your page layout, that will help. |
|
Back to top |
|
pedrotester Smarty Regular
Joined: 06 Jun 2019 Posts: 40
|
Posted: Fri Aug 16, 2019 8:03 pm Post subject: |
|
|
you can use modifier |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Wed Aug 21, 2019 8:18 am Post subject: |
|
|
pedrotester wrote: | you can use modifier |
That would be the worst possible solution. |
|
Back to top |
|
pedrotester Smarty Regular
Joined: 06 Jun 2019 Posts: 40
|
Posted: Wed Aug 21, 2019 5:54 pm Post subject: |
|
|
Why is it worse than cropping it with CSS? I can do both but I chose truncate. I mean in the case where you have to click "read more" and it opens a new page, not display the whole text. |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Thu Aug 22, 2019 4:59 am Post subject: |
|
|
CSS does not crop, it hide the content from view, but it's still present on the page.
I.e. search engine bots will see full text, rather than ellipsized version like in your case.
And you don't need to open new page, just change CSS attribute, to see full text. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|