Search

Hi there!

My setup:

I have several pages, to form a first level navigation. Then, instead of classic subpages, i have sections (one for each page) with entries. Entries have the title textfield, which all together form a nice, somehow simulated, submenu.

So far, so good. But.. My second DS, which pulls out actual content, relies on url-var (obviously), which is not set, if i’ve not clicked on submenu item, thus, i’m getting an empty page, when accessing from first level click. Sad, isn’t it?

So, how do i fire up that content-puller DS without the required url-var? Any ideas?

I can not hardcode this, because i never know, which entry will be first one - they can be added/removed/reordered/etc. And, anyway, this would not be the “proper way of doing things”. And making navigation as intended is way too much of a wizardry for an average IT-fobic client - a real “kettle-drum-rampage” in the middle of otherwise excellent piece of Symphony. :)

Truly hope, that somebody could shed some light on this.

Tried a zillion combos to set that default value - data chaining, literals, etc, but to no avail.

Docs states, that these rules work “if parameter is not set”, but in real life it is always set — to an empty value. May this be the problem, why even the simplest rules, eg - {$color:red}, is being ignored?

May be some smart regexp is possible? Something like: if $page-handle = ” then use $ds-first-entry.

But, It looks like, that by now i will implement javascript redirection in xsl, rather than tinkering all day with this. Deadlines feels no mercy :)

Anyway, a possible solutions to this problem are welcome.

Best wishes, Komb

You could use something as

{$entry-title:default-title}

in your DS. It will not redirect you but load the entry with the handle “default-title”.

As i said - it’s not working. May be it’s a bug in RC3, or something. in debugger variable remains empty.

I don’t believe thats a bug.

{$color:red} takes the value of $color, if the param is set. If not, it takes “red”, however it does not change the value of the param $color!

P.S. I didn’t properly read your post before. Sorry for suggesting the solution you were already considering.

Actually it’s my first symphony project, and maybe i’m missing some part of the picture.

But (as far as i understand):

I set the required url-var for the page ($page-handle in my case). Everything works fine, when there is some data passed to it via the url. If data is not passed, page creates an empty $page-handle = ”.

The result: the param IS set, but the value is void and, because of that {$page-handle:whatever} is not working, because it only works when the param is NOT set.

True/false?

As a temporary solution i created an utility to do the redirect thing.

Here is the code, if someone is interested:

<script language=”javascript”> <![CDATA[ var x = ‘./]]><![CDATA[‘; window.location = x; ]]> </script>

It gets called, when there are no actual content nodes found. Use with caution, because it’ll not work, if javascript is turned off.

Ups.. i think i broke the forum with that cdata thing :) It actually tries to execute that code, despite the “code” wrapper in the text editor.

Sorry, but i cannot remove it by myself - template error, when trying to edit post.

Hello,

I’m new to symphony and have this problem too. I have a Portfolio page with Project entries as subpage.

My structure:

  • Portfolio (page - URL Parameters : project-title)
    • Project a (entrie from project section - Required URL Parameter:
      $project-title)
    • Project b (idem)
    • Project c (idem)

Inside Project entry, i display project content with a submenu (list all projects)

So, i have two included DS in page Portfolio:

  1. The first with Project content - Required URL Parameter: $project-title - Sort By Project Title - ascending
  2. The second with the listing of all Projects - Sort By Project Title - ascending

I would like to redirect portfolio page to the first project entry.

I try with {$project-title:Project a}, It’s work but it’s hardcoded. Is it possible to make something like this :

{$project-title:variable which selects first project}

Another problem is the duplicate content: 2 url with same content “porfolio” and “portfolio/project a”.

Have you got any idea for this ?

Try

<xsl:param name="project-title">
    <xsl:if test="$project-title = ''">
        default-title-here
    </xsl:if>
</xsl:param>

At the top of your stylesheet, after the output parameter

I try your solution but $project-title param stay blank and all content are loaded on portfolio page.

I have made this before your response :

I have replaced the Required URL Parameter {$project-title:Project a} by {$project-title} in my DS, then i use this:

<!-- portfolio page template -->
<xsl:template match="data">

    <xsl:choose>

        <!-- if project-title is set load project single page -->
        <xsl:when test="$project-title != ''">
                <xsl:apply-templates select="get-projects/entry" />
        </xsl:when>

        <!-- if project-title is not set load the first project -->
        <xsl:otherwise>
                <xsl:apply-templates select="get-projects/entry[1]" />
        </xsl:otherwise>

    </xsl:choose>

</xsl:template>

But there are always two problems :

  1. On portfolio page all xml are loaded
  2. The duplicate url problem

The duplicate url problem

You can solve it using Unique Text Input Field extension.

When i said “duplicate url problem”, i wanted to say duplicate content with the same url.

2 url with same content “porfolio” and “portfolio/project a

Sorry if i’m not clear.

Hi, Antonin.

Possibly an outdated reply, but still.. for others who search the forums, instead of momentarily asking :) And for Symphony DEVS.

Backend is lacking in terms of simulating frontend’s navigation structure - it is up to developer to expertise client’s level of possible abstraction to operate his/HER website.

My very ugly monkey-aware way out is having two datasources (DS) per section - one for actual content (pulled by page-handle), other for sub-navigation, formed from entries in a section (For entries I have special field - Title in nav (acts as page-handle)).

Uglyness comes in, when first level navigation item is clicked - xsl checks for valid content node - if not found (handle is not set), it writes javascript window.location = root+page+subnav[1]/title-in-nav (<simplified code). Afterwards handle is finally set and content is pulled.

…If only we could dream of dynamic default filter values ( {$handle:$section.entry[1].handle} ), and also of dynamic section selector by some variable. Then my duplicated 50 DS-es could become THE ONE!

For everyone: This is only AFAIK - correct me, if I’m wrong, or describe Your approach to this problem (actually it is a problem).

Merry winter, k.

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