sort by taxanomy

A forum for Bolt related questions / issues

sort by taxanomy

Postby dakanca » Mon Mar 25, 2013 5:08 pm

Hello everyone.

I need help with subject, how to make page with all content associated with category.

Who knows in drupal it looks like a list on page mysite.com/taxonomy/term/

Thanks
dakanca
 
Posts: 7
Joined: Mon Mar 25, 2013 8:56 am

Re: sort by taxanomy

Postby Bob » Wed Apr 03, 2013 3:31 pm

Use /tag/foo or /category/movies

For an example, see the default template:

Code: Select all
{% if record.taxonomy is defined %}
    {% for type, values in record.taxonomy %}
        <em>{{ type }}:</em>
        {% for link, value in values %}
                <a href="{{ link }}">{{ value }}</a>{% if not loop.last %}, {% endif %}
        {% endfor %}
        {% if not loop.last %} - {% endif %}
    {% endfor %}
{% endif %}


Will output all taxonomy of a record, with links to the pages.
Bob
Lead Developer
 
Posts: 1374
Joined: Tue Nov 20, 2007 11:16 pm

Re: sort by taxanomy

Postby dakanca » Thu Mar 13, 2014 10:27 am

Pardon me, for that long is not answered.

Did not have time to work on my Bolt site. :oops:

Thanks for help Bob, but the problem remained. It's my fault, I incorrectly explained. :cry:

I have "contacts" taxonomy term, and I need to create page, where all related to this taxonomy term pages will be shown.

I want to create page with its template, where all related contents shown in jQuery tabs, and with URL "domain.com/contacts/"

I read documentation, but can t find information about it.
dakanca
 
Posts: 7
Joined: Mon Mar 25, 2013 8:56 am

Re: sort by taxanomy

Postby dakanca » Thu Mar 13, 2014 11:38 am

I create taxonomy:
Code: Select all
contacts:
    name: Contacts
    slug: contacts
    singular_name: Contacts
    singular_slug: contacts
    behaves_like: categories
    multiple: false
    options: [ Компания, Сеть магазинов, Филиалы ]
    listing_template: contacts-list.twig


And call it in content template with this code:
Code: Select all
{% if record.taxonomy is defined %}
    {% for type, values in record.taxonomy %}
        <em>{{ type }}:</em>
        {% for link, value in values %}
            <a href="{{ link }}">{{ value }}</a>{% if not loop.last %}, {% endif %}
        {% endfor %}
        {% if not loop.last %} - {% endif %}
    {% endfor %}
{% endif %}


When I go to link domain.com/contacts/kompaniya, I look this message:
Image
dakanca
 
Posts: 7
Joined: Mon Mar 25, 2013 8:56 am

Re: sort by taxanomy

Postby Bob » Fri Mar 21, 2014 4:47 pm

I advise againts using the same "slug" and "singular_slug":

Code: Select all
    name: Contacts
    slug: contacts
    singular_name: Contact
    singular_slug: contact


Also, make sure the page you're linking to is acutally "published".
Bob
Lead Developer
 
Posts: 1374
Joined: Tue Nov 20, 2007 11:16 pm


Return to Bolt Discussion

Who is online

Users browsing this forum: No registered users and 4 guests

cron