Yes that's because the XXX is not entered in your page title field. It just says "1111" - If you want the XXXX to come from your page title field (Your property) then you need to add it in the field so it says "XXXX 11111" and then remove the "insertBefore" attribute.
And the example I showd in my previous post really should work. This one <h1><umbraco:Item field="pageTitle" insertBefore="XXX - " runat="server" /></h1>
The stuff in "Insertbefore" should be prepended before the title is written.
Could you try to make some screendumps of the entire code for your template and what it looks like on your frontend?
Umbraco | title suffix
My site contains
Base.master
file with a<head>
sectioni am trying to always have "XXX- " as a suffix on each page title:
If I run this the result is title= "Title1"
Base.master
->Master.master
->home.master
The file
home.master
inherits fromMaster.master
and doesn't have the<head>
tag.Can someone please explain how to do it?
Hi Eran and welcome to our :)
So should it explicitly always be "XXX" that's prefixed to every title of your website? Or does "XXX" represent a static name?
If so you should be able to use the dialog where you choose, which item to fetch datafrom and add a "insertbefore" value.
So it would like something like this
<umbraco:Item field="pageTitle" insertBefore="XXX - " runat="server" />
Is this what you're looking for?
/Jan
What I did was:
<title> <umbraco:Item field="pageTitle" runat="server" insertBefore="XXX- " /></title>
the title is "Title1" without the XXX- "why is that?
Hi Eran
Seems I misunderstood your initial question...Does Master.master inherit from Base.master? If not then the tag won't be inherited to the home.master.
/Jan
I'll try to explain better.
I have 2 Master forums.
The inheritance is like that:
in Base.master
In the CMS admin section:
The result is: "11111", without the "XXX- " suffix.
?
Hi Eran
Yes that's because the XXX is not entered in your page title field. It just says "1111" - If you want the XXXX to come from your page title field (Your property) then you need to add it in the field so it says "XXXX 11111" and then remove the "insertBefore" attribute.
Does this make sense?
/Jan
Hi, sorry but it not make sense:) today in a regular project(not Umbraco) with master page, in the masterpage code behind I can write
and then in an aspx page(that inherits from the master) I set the title in the page directive
then on each page that I create a suffix "XXX |" is inserted before, and the title right after it.
this is what i am after for. can it be down with Umbraco?
Hi Eran
Ok - But yes! Umbraco can do that.
And the example I showd in my previous post really should work. This one
<h1><umbraco:Item field="pageTitle" insertBefore="XXX - " runat="server" /></h1>
The stuff in "Insertbefore" should be prepended before the title is written.
Could you try to make some screendumps of the entire code for your template and what it looks like on your frontend?
/Jan
is working on a reply...