Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Eran 28 posts 78 karma points
    Jul 03, 2014 @ 09:43
    Eran
    0

    Umbraco | title suffix

    My site contains Base.master file with a <head> section

    i 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 from Master.master and doesn't have the <head> tag.

    Can someone please explain how to do it?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jul 03, 2014 @ 10:36
    Jan Skovgaard
    0

    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

  • Eran 28 posts 78 karma points
    Jul 03, 2014 @ 21:50
    Eran
    0

    What I did was: <title> <umbraco:Item field="pageTitle" runat="server" insertBefore="XXX- " /></title> the title is "Title1" without the XXX- "

    why is that?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jul 03, 2014 @ 22:09
    Jan Skovgaard
    0

    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

  • Eran 28 posts 78 karma points
    Jul 06, 2014 @ 17:02
    Eran
    0

    I'll try to explain better.

    I have 2 Master forums.

    The inheritance is like that:

    Base.master -> Master.master -> home.master

    in Base.master enter image description here

    In the CMS admin section: enter image description here

    The result is: "11111", without the "XXX- " suffix.

  • Eran 28 posts 78 karma points
    Jul 07, 2014 @ 02:37
    Eran
    0

    ?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jul 08, 2014 @ 20:24
    Jan Skovgaard
    0

    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

  • Eran 28 posts 78 karma points
    Jul 11, 2014 @ 02:57
    Eran
    0

    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

    Page.Title = "XXX | " + Page.Title;
    

    and then in an aspx page(that inherits from the master) I set the title in the page directive

    <%@ Page Title="1111" Language="C#" MasterPageFile="~...." 
    

    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?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jul 14, 2014 @ 11:21
    Jan Skovgaard
    0

    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

Please Sign in or register to post replies

Write your reply to:

Draft