GetSimple Support Forum

Full Version: Line break in title
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is there any way to force line break (or   ) in page/article titles? 
You can maybe use a component instead of the page title
non breaking title

force a line break is something else..

line breaking<Br/>title

however html in titles will be deprecated in 3.4 probably. But for now it kind of works, as a "feature"
(2015-06-24, 08:42:04)shawn_a Wrote: [ rel="nofollow" -> ]non breaking&nbsp;title

force a line break is something else..

line breaking<Br/>title

however html in titles will be deprecated in 3.4 probably. But for now it kind of works, as a "feature"

Thanks Shawn, 
I know those two are different things, but one of them would kind of solve my problem.

However, it doesn't work for me in page titles. I suppose slashes and brackets (and other special characters) get "escaped". 
As an alternative to a component you can use a custom field which you name custom-title for example, place the code
PHP Code:
<?php get_custom_field('custom-title'); ?>
in your template at the place where your title should be. In that field you can use <br> (html5) or <br /> . Best to make a seperate template file if you want to use this, but not in every page.

Although placing <br> (html5) or <br /> in the title without using custom fields is easyer and works fine as well.
I am sure I have been unable to insert a break with an html  <br> tag. Or was that in the Site Title field? Is that set up differently to Page Title?
(2015-06-24, 19:32:27)Timbow Wrote: [ rel="nofollow" -> ]I am sure I have been unable to insert a break with an html  <br> tag. Or was that in the Site Title field? Is that set up differently to Page Title?

You can't set a <br> or <br /> in the Website Name setting. Well you can, but it's ignored in the output.
to: datiswous, Timbow > Thanks for the tip, guys. Workarounds with components/custom fields could work, but I'd like to stick to the core functionality of page titles mainly for the reason of i18n plugins mutual compatibility. It may get rather messy when trying to hack around stuff, especially on a multilingual website. 
Haven't tried, but what about using \n and setting the heading's CSS to white-space: pre ?
(2015-06-26, 23:16:52)Tyblitz Wrote: [ rel="nofollow" -> ]Haven't tried, but what about using \n and setting the heading's CSS to white-space: pre ?

Good idea, but all such attempts fail, because every special character in the title gets escaped. Including backslashes :/
No matter what character I put into the title, it won't affect its formatting. I suppose one of the reasons is security (data consistency).

I think we need a volunteer willing to make a plugin for this Smile
Have you replaced <?php get_page_title(); ?> in your template by another function? (e.g. the one in Custom Title plugin, or other)

If you don't, GS currently still supports (uses) html in pages' titles. I've just tested this with a <br>
(2015-06-27, 00:22:03)Carlos Wrote: [ rel="nofollow" -> ]Have you replaced <?php get_page_title(); ?> in your template by another function? (e.g. the one in Custom Title plugin, or other)

If you don't, GS currently still supports (uses) html in pages' titles. I've just tested this with a <br>

Ah, so that's why html isn't working for me. Yes, I'm using this: 
PHP Code:
return_i18n_page_data('about-us-box')->title 
Why? Because I need all page titles on home page and I need to be able to work with them separately. 


Thanks for pointing that out, Carlos.
You could then use htmlspecialchars_decode(...)
Code:
<?php get_custom_field('custom-title'); ?>

this one is not working for me can I use the default HTML code?