Search

I'm just starting and I have a problem to understand how that works. I'm porting a static site into symphony cms.

Let's say there is this structure:

/ - home
/color/blue/ - the blue color page
/color/red/ - the red color page
/color/green/ - the green color page

Maybe this is completely wrong, this is how I started:

  1. I created a "color"-section.
  2. I created a "color"-datasource.
  3. I created a "color"-page.

This works fine in the sense that the "color" link works and shows the (empty) color 'overview' page. I also added a slug field to the "color"-section so that I could use it as URL parameter to obtain the specific dataset.

I'm wondering now, how the other Articles can work w/o a slug field by a sort of URL-normlized title value whereas I do not see anything like that for the "color"-section.

Additionally I don't know why my navigation does not list sub-pages. It lists everything toplevel/flat, but not beneath. For example the "color"-section entries aren't in that navigation data, the main page is, but not the sub-pages.

I'm barely new to all this, so please apologize if what I did is totally in the wrong direction.

It looks like you've got a good start. Within the color section, do you have a field named "color title" or something where those entries would be named blue, green, red?

If so, then you'll be able to add "thecolor" as a URL Parameter of the "color" Page. Then, in your data source you can filter based on the parameter "thecolor"

If you haven't done it already - the Tutorials on this site go through a very similar process. I'd start with the Say Hello to the World one.

Thanks for your feedback, that's really helpful.

I have create first a title and a body field. I wanted to copy over the static HTML content I already have from the static page into there (minus the "master" design naturally).

Using the title with the datasource/page did not work (color was Blue and another was Light Blue), /color/blue/ and /color/light-blue/ didn't work, probably because of the trailing slash? Anyway, that's for what I create the slug field and it did work with that one (because it contains blue or light-blue then).

I went through the bespoken tutorial, it helped me to gain understanding with the templates specifically.

However, I wonder how the sub-pages become available in the <navigation> data as I'd like to create a submenu now on the exemplary color section on my site.

I've taken the main menu over from the theme that shipped with symphony cms and could already change everything with it so I could preserve my CSS working.

The submenu is different on each site-section, e.g. for colors it will only show the three color pages next to each other, but I need to get that data somehow. I think I need to get it into <navigation> somehow, but so far <navigation> only has my toplevel pages:

 <navigation>
   <page handle="color" id="77">
      <name>Color</name>
    </page>
   <page handle="articles" id="69">
     <name>Articles</name>
     <types>
        <type>hidden</type>
     </types>
    </page>
   <page handle="drafts" id="70">
     <name>Drafts</name>
     <types>
        <type>admin</type>
      </types>
    </page>
    ...

(Articles and Drafts are from the ready-made default site, the rest is the standard stuff as well, I cutted it off because it's redundant)

So I'm basically wondering how it's possible to get the color pages in there, like red, blue etc..

Or am I wrong that <navigation> is able to get those?

As far as your first question - you are right that the title field must contain ONLY the words "blue" or "light blue" and if that isn't the case - then creating another field called slug was a good idea. The trailing slash is actually required by Symphony.

Navigation is only for getting those Pages you have created under the "Pages" area, so you will use normal datasources to grab entries from the color Section.

I tend to make my navigation partially static and partially dynamic. Sometimes I'll hard-code the top level pages (although the navigation datasource could potentially work too) and then within those drop downs I'll pull entries from different sections using standard datasources. Something like:

  • Colors - Hardcoded
    • Blue - Dynamic from standard datasource
    • Yellow - Dynamic from standard datasource
    • Green - Dynamic from standard datasource
  • News Categories - Hardcoded
    • Shoes - Dynamic from standard datasource
    • Socks - Dynamic from standard datasource
    • T-Shirts - Dynamic from standard datasource

Thanks for your feedback, very helpful again to clarify things.

I'll take a look into what you describe about another datasource for the subnavigation. It looks like that this would be the appropriate case for this color sections template.

I have now build the subnativation with a datasource of it's own. It turned out that this was somewhat really useful, because I could re-use that datasource as well for the homepage where it's used in some kind of intro.

Now I'm stuck at the part that the default page does not exists, so the default page should be the first child page.

I could make use of an redirect, which might be generally useful, or I'll kick the main navigation completely because it does not allow me to specify links if I'm right. I'll see.

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