5 Replies Latest reply: May 2, 2012 2:54 PM by ryan sullivan2 RSS

    Page Title

    929656
      Hi,


      I am trying to create a page template and am including it as a primary page in several sections. I have placeholders in the page that gets mapped to different subtemplates for different sections.

      Problem: There is no convenient way of changing the Page title (default is "(untitled)") specific for each section.

      What I have tried: I tried using $pageTitle="New Title" in one of the fragments and tried to include the fragment in body, head. It does not seem to work.

      Does anyone have an idea on some other stuffs I can try out?

      Thanks,
        • 1. Re: Page Title
          ryan sullivan2
          You could always use javascript to update the title.

          -ryan
          • 2. Re: Page Title
            929656
            Sure. Is there a way I can get section name in java script?
            • 3. Re: Page Title
              stellentpmp
              Just do this in the page template:
              <title><!--$wcmFragment("wcm", "[fragment content ID]", "[fragment ID]", "[snippet]")--></title>

              And then just update the fragment to reflect what you want.

              Alternatively, switch to Design mode and click on the placeholder (ie. region1). Then in the "Properties" window, update the "Title" property to what you want. You can also put idoc in there.

              To get the section label in idoc, use <!--$sectionLabel = ssGetNodeLabel(siteId,nodeId)-->

              Hope this helps.
              • 4. Re: Page Title
                929656
                Sure that provided an important clue. Here is what I did:

                1) Tools -> Define Custom Section Properties, I added a new property "SectionNodeId".
                2) For each of my section I configured this value to be equal to SectionId
                3) I then went to the common page (that acts as a primary page in multiple sections) and clicked on a placeholder. That showed up "Title" property in the Properties window.
                4) I put this "<!--$ssGetNodeLabel("<Hardcoded site id>",ssGetNodeProperty("SectionNodeId"))-->" in the Title.

                It worked. Thanks for your help.
                • 5. Re: Page Title
                  ryan sullivan2
                  Nice job!