is there any way to include a manual break inside a headline (for example if it is really long). In other CMS this is for example a pipe "|" which forces a line break.
I guess you could also use a pipe in your headins in umbraco and then when you fetch the value using a macro based on XSLT for instance you can use the umbraco.library:Replace extension to replace the "|" sign with a <br /> element.
Just create another property named "headline" and use this instead of the @nodeName, then you can have one normal and one with whatever breaks you need.
You can also default to the @nodeName but use the headline when you need to override it.
Yes, the user would enter the information in the backend, if they need a line break they enter the headline into a Rich Text Area, if not then they leave it empty.
Certainly you can strip out whatever you want from the URL, but the doesn't seem logical to me.
The property is not for a URL though right? It's just to display a longer <h1>headline</h1> on the page that maybe different to the nodeName, or did I understand you incorrectly?
I need this information for display the headline and the Link of the URL in the navigation.
For example if The URL does not fit in a navigation box we have to cut. This could be done via css but than it is cutted on any characters so the backend user should control this by pasting a | after the char the item should be splitted into two lines
I don't have much to add to what Rich is saying but I thought you were already using a text property and not the @nodeName property. Plings should not occur in a link :-)
One possible solution that might help is the Jesper's Easy Values package.
This would allow you to create a separate field called Headline, but it would be automatically populated with the name of the node upon creation. It's a great helper to Rich's idea because it saves the user from having to input again (unless they want to change).
To use it all you have to do is install, and name your headline field umbHeadline. You could also make this a textbox multiple field so line breaks can be entered (you'd need to replace with <br/> in XSLT).
You should be able to get rid of | in URL's by editing /config/umbracoSettings.config in the URL Replacement section. You can specify that | gets replaced with nothing.
You get 404 when doing what? Trying to access a URL with a pipe still in it? You might need to republish your pages to get rid of the pipe from the URL.
As Tom is saying you're probably better of using a XSLT macro to handle this instead.
It's always a good idea to consider how much you need to manipulate the value that should be displayed on the website. If you have to do things like replace or truncate or stuff like that then you need to use a macro.
If you just need to fetch the value then you should simply just use an umbraco:item.
Manual Line Break in Headline
Hi everybody,
is there any way to include a manual break inside a headline (for example if it is really long). In other CMS this is for example a pipe "|" which forces a line break.
Would be great if someone can help
Hi Dominik
I guess you could also use a pipe in your headins in umbraco and then when you fetch the value using a macro based on XSLT for instance you can use the umbraco.library:Replace extension to replace the "|" sign with a <br /> element.
Hope this helps.
/Jan
I put some <br /> Inside the title and use disable-output-escaping="yes" inside my xslt.
This works but the link is not in the correct way. How can i ensure that the URL is not like:
http://domain.de/test/this-is-a-very%3Cbr-%3E-long-navigation-point.aspx
So the <br /> tag should not appear in the URL - everytime i put an <br /> inside it should be ignored
Hi Dominik
What does the XSLT file look like?
/Jan
now i´ve got the following xslt which replaces the | with <br> and it works
but the urls should ignore any special character otherwise i can not reach the url
Umbraco try to go to a url like this-is-a-very<br>long-test.aspx
Dominik,
Just create another property named "headline" and use this instead of the @nodeName, then you can have one normal and one with whatever breaks you need.
You can also default to the @nodeName but use the headline when you need to override it.
Rich
Oh but this an entry more for the user who is using the backend. Is there no possibility of not parsing | or <br> in the URL?
so look if there is a | or <br> inside the nodeName and if yes replace it with '' but only in the URL?
Yes, the user would enter the information in the backend, if they need a line break they enter the headline into a Rich Text Area, if not then they leave it empty.
Certainly you can strip out whatever you want from the URL, but the doesn't seem logical to me.
Rich
So you would create a new property called "longURL" am i right?
And than i have to check on each XSLT script if longURL is filled out and if not use nodeName?
Is this the correct solution?
Thanks
That's what I would do yes.
The property is not for a URL though right? It's just to display a longer <h1>headline</h1> on the page that maybe different to the nodeName, or did I understand you incorrectly?
Rich
I need this information for display the headline and the Link of the URL in the navigation.
For example if The URL does not fit in a navigation box we have to cut. This could be done via css but than it is cutted on any characters so the backend user should control this by pasting a | after the char the item should be splitted into two lines
Hope now you understand what i want to do
Hey,
Makes sense.
Basically create a property called 'headline' (or longURL if you want but doesn't make sense really as you are not using it for the URL)
When you need to use the <h1>Headline</h1> in xslt you
- check to see if 'headline' is blank,
- if not use headline
- otherwise use @nodeName as the headline
Then when you want to show a link you can always use:
Hope I understood you correctly
Rich
Hi Dominik
I don't have much to add to what Rich is saying but I thought you were already using a text property and not the @nodeName property. Plings should not occur in a link :-)
/Jan
But one thing.
If I am using your method the URL can be a complete other than the headline - this should not be.
I need the Title (nodeName) to be displayed as Headline and as Navigation Link Text.
But I have to brake sometimes the link if it is too long.
It would be great if there is a other possibilty as create a new "headline" tag. This will confuse the backend user.
I just want to add a | to the nodeName everytime the user wants to brake the Text.
But the URL does not work if I add a pipe for example
Hi dominik,
One possible solution that might help is the Jesper's Easy Values package.
This would allow you to create a separate field called Headline, but it would be automatically populated with the name of the node upon creation. It's a great helper to Rich's idea because it saves the user from having to input again (unless they want to change).
To use it all you have to do is install, and name your headline field umbHeadline. You could also make this a textbox multiple field so line breaks can be entered (you'd need to replace with <br/> in XSLT).
I use this in all my solutions.
-Tom
Thanks Tom,
Is there no other solution as adding a new "Headline" line - because than i have to edit all of my different document types, xslt files etc.
Just want to replace the "|" in the URL with "null" so I can reach the URL
You should be able to get rid of | in URL's by editing /config/umbracoSettings.config in the URL Replacement section. You can specify that | gets replaced with nothing.
Ok but still get the error 404 - site not found
You get 404 when doing what? Trying to access a URL with a pipe still in it? You might need to republish your pages to get rid of the pipe from the URL.
oh ok sorry :-)
It works now - but just saw in the template i am using :
I need to also replace | with <br /> here - how can I handle this outside my template?
You can use inline XSLT on umbraco:item tags, ex:
oh ok and
disable-output-escaping="yes"
i can also add?
Until now it writes <br />
Hmm...sorry, not sure how you'd handle that.
As a workaround you could create an XSLT macro to use instead of <umbraco:Item> in those cases and pass the field name in as a parameter.
so i can not use disable-output-escaping in the Template?
Hi Dominik
I don't suppose you can when using inline XSLT.
As Tom is saying you're probably better of using a XSLT macro to handle this instead.
It's always a good idea to consider how much you need to manipulate the value that should be displayed on the website. If you have to do things like replace or truncate or stuff like that then you need to use a macro.
If you just need to fetch the value then you should simply just use an umbraco:item.
Hope this helps.
/Jan
is working on a reply...