Search

This is probably a pretty simple question and I think I'm close to the solution, thanks to Nick Dunn's great post (http://getsymphony.com/discuss/thread/25633/), but, I need a helpful shove:

I'm building a menu of user-generated categories. You click on a category and all entries filed to that category are listed. It will then have an active state as well.

This menu isn't a fundamental part of the navigation, rather, it shows up in 3 pages of the site.

Right now, I have the two sections, Categories and Offerings, that are linked with the select box field. For those who are, like myself, very hands on/need visual aids, I've attached a screenshot of the design for this page.

I'm really interested in reading how others have gone about this. Thanks for the help!!

Attachments:
theidea.jpg

Lindsey, would you mind posting your XML?

Right now, I have the two sections, Categories and Offerings, that are linked with the select box field. For those who are, like myself, very hands on/need visual aids, I've attached a screenshot of the design for this page.

You might consider linking the sections via the Select Box Link field instead of the select box field. The select box link field works almost in an identical way to the standard select box field, however there is no static option and entries are linked internally via their ID, meaning that if an entry is changed, any Select Box Link fields will not lose their link to that entry.

So, now you can chain your data sources together from the select box link fields. Here's a thread on a Data Source Chaining example.

Working through that thread. Really great, thanks!

So, I currently have the categories filtering when clicked. Score! However, here's a new hurtle that I think is best explained by showing you an example:

URL when nothing has been clicked: mysite.com/page/

URL once a category is selected: mysite.com/page/category

URL once you opt to view another category: mysite.com/page/category/category

Now, of course, that last one brings everything to a halt. I'm thinking I must need some sort of choose, when, otherwise statements to fix this. I'm definitely going to keep working through that thread you recommended.

Oh, and here's the xsl…

<xsl:template match="data">
    <h2>Categories</h2>
    <ul>
        <xsl:apply-templates select="security-categories/entry"/>
    </ul>

    <ul>
        <xsl:apply-templates select="security-offerings/entry"/>
    </ul>


…and, the xml

<data>
<params>
    <today>2011-04-21</today>
    <current-time>10:38</current-time>
    <this-year>2011</this-year>
    <this-month>04</this-month>
    <this-day>21</this-day>
    <timezone>-05:00</timezone>
    <website-name>KellTech Systems</website-name>
    <page-title>Security</page-title>
    <root>http://kelltech.eyegatedigital.com</root>
    <workspace>http://kelltech.eyegatedigital.com/workspace</workspace>
    <root-page>security</root-page>
    <current-page>security</current-page>
    <current-page-id>77</current-page-id>
    <current-path>/security/?debug=xml</current-path>
    <parent-path>/</parent-path>
    <current-url>http://kelltech.eyegatedigital.com/security/?debug=xml</current-url>
    <upload-limit>5242880</upload-limit>
    <symphony-version>2.2</symphony-version>
    <category />
    <cookie-username>lindseyb</cookie-username>
    <ds-security-categories>
        <item handle="29">29</item>
        <item handle="27">27</item>
    </ds-security-categories>
</params>
<security-categories>
    <section id="15" handle="security-categories">Security Categories</section>
    <entry id="29">
        <label handle="safes">Safes</label>
    </entry>
    <entry id="27">
        <label handle="security-cameras">Security Cameras</label>
    </entry>
</security-categories>
<security-offerings>
    <section id="13" handle="security-offerings">Security Offerings</section>
    <error>No records found.</error>
</security-offerings>

Update: fixed that url problem by replace this:

<xsl:template match="security-categories/entry">
<li>
    <a href="{label/@handle}/">
        <xsl:value-of select="label"/>
    </a>
</li>   

with this:

<xsl:template match="security-categories/entry">
<li>
    <a href="{$root}/{$root-page}/{label/@handle}/">
        <xsl:value-of select="label"/>
    </a>
</li>   

So, next step is an active state for the currently selected category… And, wala! this seems to work:

<xsl:template match="security-categories/entry">
<li>
    <xsl:if test="$category = label/@handle">
                <xsl:attribute name="class">current</xsl:attribute>
        </xsl:if>
    <a href="{$root}/{$root-page}/{label/@handle}/">
        <xsl:value-of select="label"/>
    </a>
</li>   

Sorry about the long thread…hopefully all this helps someone else.

Awesome! I'm glad you got it fixed. Also, thank you so much for posting your solution. That is always helpful to other users. Thanks again!

And thanks for helping me talk myself through my problem! :)

No problemo! Glad to be of help. FYI, I noticed from your example that you were mentioning a company from Dallas. If you are local to Dallas, I know of some other Symphony folks (including myself that are in Dallas). Good to know there are more Symphony folks in Dallas.

. FYI, I noticed from your example that you were mentioning a company from Dallas. If you are local to Dallas, I know of some other Symphony folks (including myself that are in Dallas). Good to know there are more Symphony folks in Dallas.

this is interesting. i know this is short notice, but i'm going to be in austin next weekend, and dallas is on my way back to missouri. would anybody be interested in getting together for food and a drink sunday night? should we start a thread?

Adam, it wouldn't hurt to start a thread. Since that is Easter day, I'll be with my family for dinner so I'll be unable to join in.

sunday, may 1st :)

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