Search

When setting up pages I configure the homepage of a website with the page type index. If I have a section called news, it will be accessible under two links / (root) and /news. Is there a way to distinguish between those to links? I'd like to be able to hide parts of the content when a visitor is not on the main frontpage.

Any ideas?

If only the Server Headers extension was available for this version of Symphony, it would be simple.

In the xml, under the <navigation>, there's <type> info per each page link you can use.

In the xml, under the <navigation>, there's <type> info per each page link you can use.

That right, but it doesn't help because this information is always the same. It doesn't matter if the page is shown as root (index) or under the current page link.

why not give your root index the value of root? then you will always know only one value will be root. Also, doesn't it only allow one instance of index? if that's the case, then you won't need to add the root value.

I'm not sure if we are talking about the same thing.

In my case the two states I'd like to distinguish are related to the same page. This page is set as index (where only one instance is allowed) but is accessible under two links: The root / and the page name /page-name. I'd like to know which of both links is used (to show up the same page) for being able to change content depending on this.

The problem is, both links set the parameter $current-page to page-name and in both cases the navigation DS returns index as page type (which is what the DS should do).

Well, if you've you've got two separate URLs with two different sets of content, shouldn't they be two separate pages? Or is the variation in content very subtle?

Or is the variation in content very subtle?

Normally the two links will look exactly the same: they will show current news. But if there is a special event, there should be some kind of "splash screen" promoting it on the frontpage. The link /news should then show up the normal news page again.

My news section has checkbox Promote on Frontpage so it's not problem to change the look of the frontpage when an event should be promoted. The problem is to get the normal view without promotion, when clicking on the link to the news page in the navigation.

why not make two different pages then and duplicate them? what you can also do is create a call-template that both pages share and then determine whether or not you're on the / page or the /news page, but still control both pages from one xsl file/template.

I tested this out with somethings i've been doing to see if it's on a preview page or if it's on a regular page and so far it has worked out fine.

If only the Server Headers extension was available for this version of Symphony, it would be simple.

I've ported it Rev 5 for you. Hopefully it might help. Grab it here.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details