Forum

Thread tagged as: Question, Problem, Field-Types

pageNavText

In my blog-detail page i have this code

<h1>
    <span class="client"><perch:content id="klantnaam" type="text" label="Klantnaam" required="true" title="true" /> </span>
    <perch:content id="titel" type="text" label="Blog titel" required="true" title="true" />
</h1>

Then I have a page listing page that has this code

<perch:before>
<ul>
</perch:before>
    <li>
        <a href="<perch:pages id="pagePath" />">
            <perch:pages id="pageNavText" />
        </a>
        <perch:pages id="subitems" encode="false" />
    </li>
<perch:after>
</ul>
</perch:after>

The link text on the listing page only shows this part

 <perch:content id="titel" type="text" label="Blog titel" required="true" title="true" />

Is there a way the get the client part also in that title?

Ischa Gast

Ischa Gast 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

What do you mean by client part?

I have a H1 that's split into two parts, the client name and the title part.

Client part of the title

<span class="client"><perch:content id="klantnaam" type="text" label="Klantnaam" required="true" title="true" /> </span>

Title part

<perch:content id="titel" type="text" label="Blog titel" required="true" title="true" />

But for the listing page I want both parts to show up but right now it only shows the title part.

Listing page

<perch:before>
<ul>
</perch:before>
    <li>
        <a href="<perch:pages id="pagePath" />">
            <perch:pages id="pageNavText" />
        </a>
        <perch:pages id="subitems" encode="false" />
    </li>
<perch:after>
</ul>
</perch:after>

Both parts have title="true" but not both parts show up in the listing

Drew McLellan

Drew McLellan 2638 points
Perch Support

title="true" controls the title of the item as it's listed in the control panel. It has nothing to do with how the content is output on your site.

When I see the pages in the admin section I don't see that client name either.

But what I want to know how do I get both names in my link text

<a href="<perch:pages id="pagePath" />">
    <perch:pages id="pageNavText" />
</a>

Or do I need other code to display it correct and what could should it be then?

Drew McLellan

Drew McLellan 2638 points
Perch Support

The navigation is different from the content on the page. Content won't be added to the navigation unless you put it there.

You could maybe use a page attribute - try that.

I see now that it's different, problem is fixed. Thank you!