Page 1 of 1

sort by taxanomy

PostPosted: Mon Mar 25, 2013 5:08 pm
by dakanca
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

Re: sort by taxanomy

PostPosted: Wed Apr 03, 2013 3:31 pm
by Bob
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.

Re: sort by taxanomy

PostPosted: Thu Mar 13, 2014 10:27 am
by dakanca
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.

Re: sort by taxanomy

PostPosted: Thu Mar 13, 2014 11:38 am
by dakanca
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

Re: sort by taxanomy

PostPosted: Fri Mar 21, 2014 4:47 pm
by Bob
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".