Page 1 of 1

Core lastupdate force an extra line

Posted: Fri Jan 29, 2016 2:23 pm
by lillebitte
CMSimple do not fully separate layout and styling from the content.
You can not CSS style the lastupdate function on one line on your site, core inserts a <br> before the timestamp.
Furthermore unlike other text strings in the language file, core places a colon between the text and the <br>. If you empty the text field in the language file you get a colon and the <br> tag, e.g. like

:
January 29, 2016

Re: Core lastupdate force an extra line

Posted: Fri Jan 29, 2016 2:57 pm
by lillebitte
I am talking about CMSimple_XH and it doesn't work with <?php echo lastupdate('');?> in the template.html

Re: Core lastupdate force an extra line

Posted: Fri Jan 29, 2016 2:59 pm
by Gert
lillebitte wrote:I am talking about CMSimple_XH ...
I have seen it in the Danish Thread, that's why I have deleted my post.

Re: Core lastupdate force an extra line

Posted: Fri Jan 29, 2016 3:03 pm
by lillebitte
Ok :)

Re: Core lastupdate force an extra line

Posted: Fri Jan 29, 2016 5:35 pm
by lillebitte
I have just learned that I can avoid the <br> with <?php echo lastupdate("true");?>, but it does not eat the colon.

Re: Core lastupdate force an extra line

Posted: Fri Jan 29, 2016 7:36 pm
by cmb
lillebitte wrote:I have just learned that I can avoid the <br> with <?php echo lastupdate("true");?>, but it does not eat the colon.
Yes, indeed that is unfortunate. Quick fix: change line 420 in cmsimple/tplfuncs.php to:

Code: Select all

$t = $tx['lastupdate']['text']; 
Probably it's best to change this generally for XH 1.7, and to add the colon to the language files where it could easily be removed or modified by the user.

PS: Just noticed that Preben already posted this solution in the Danish forum. :)

Re: Core lastupdate force an extra line

Posted: Fri Jan 29, 2016 9:11 pm
by lillebitte
Thanks, I did not dare to make changes in tplfuncs.php on my own, I stick to html and css! But now I have more solutions to choose from, awesome :)