Dynamic Page Names

I love the new Layout page set up for PHP. It's freaking awesome. But all the pages have the same name in the browser tab as the layout page. I'd like more specific page titles.

Any suggestions? Much appreciated.

Hi Brad,

There are a couple of ways to display a relevant page title. This is how I set these up in my projects.

  1. Add title to the a tags (Link type: internal)
<li class="nav-item">
  <a class="nav-link" style="text-decoration: none;" data-bs-toggle="collapse" data-bs-target=".navbar-collapse.show" aria-current="page" href="/" internal dmx-on:click="browser1.scrollYTo(0)" title="WarrantyKeeper - Warranties | Simply Organised | Powerfully Accessed" dmx-class:active="browser1.location.pathname=='/'">Home</a>
</li>
<li class="nav-item">
  <a class="nav-link" style="text-decoration: none;" data-bs-toggle="collapse" data-bs-target=".navbar-collapse.show" href="/pricing" dmx-on:click="browser1.scrollYTo(0)" internal title="WarrantyKeeper - Your digital drawer for all warranty receipts" dmx-class:active="browser1.location.pathname=='/pricing'">Pricing</a>
</li>
  1. By setting up title and description under Define Template Data and then assigning dynamic values under Server Side Data from the database.
1 Like

Thank you, I must be missing something. I add a title attribute to my nav link but it only shows me a tooltip on hover. Doesn't change my browser tab name?

<a class="nav-item nav-link text-light" href="/agency" title="CBES Quesnel: Support Agencies">Support Agencies</a>

Great! I added Internal to the link and it works perfectly!

Thank you! :beers:

1 Like

Well, almost perfectly. Adding Internal only loads the content page without the layout page. So close. :frowning:

Could you please post the code? Has the content page been linked to the main layout page?

Code for the link?

<a class="nav-item nav-link text-light" href="/agency" title="CBES Quesnel: Support Agency Administration" internal="true">Support Agencies</a>

Another strange thing is it seems the title is loading for a split second but then reverts to the title of the layout page. Could it be that my layout page has a title?

The code for a tag looks okay. Title tag on the layout page is correct.

Are layout and content pages available in PHP? I use NodeJS, so, I'm assuming that this setup has also been extended to PHP.

Yes, the team has brought the same sort of set up to PHP now as well. Maybe its a PHP bug?

Check whether the layout page has been correctly linked under App Properties on the content page.

Also check what's the setting for Links Relative To under the Project Options. In NodeJS it's set to Site Root.

Bump. Internal links appear to only load the content page without the layout page in PHP.