Jump to content

Recommended Posts

Posted

How do I implement tags in PW?

I have categories working fine but I'm speaking about allowing the users to create field values when creating a page and if that field value already exists then they just include that existing one.

Basically the exact same function Wordpress has to utilize tags. Is this possible? This seems like a feature that would be a common request.

Can anyone steer me in the right direction?

Thanks

Posted

Short version: use pages for your tags and page type field to select them. In field settings (tab "Input" to be precise)  there's an option called "Allow new pages to be created from this field?" -- this is how you can let your users create new tags on the fly.

If you need additional details, I'm sure others will fill in those for you, I'm in a bit of a hurry right now.. :)

  • Like 1
Posted

I'm also in a rush, but there is more info on this topic here: http://processwire.com/talk/topic/3567-similar-posts-by-categories-or-tags/

The "Page" method mentioned in a few of those links is the way to go really, as it allows you to add descriptions to tags, so if you have each tag as a page (not as odd as it sounds - you want to click on a tag and see a list of pages after all ;)) then you can add an associated image, introduction etc - whatever your imagination can come up with :)

Basically there is no apparent tagging system because there is no "right" way to do this in ProcessWire - it's more flexible than that.

  • Like 2
  • 3 months later...
Posted
I have a  problem with the that page field, when allowing new entries:

I set a php custom search and a template and would expect that this is all I need to have a "Allow new pages to be created from field?" being set.



I need this for tags, but I have language trees like this:

/en/tags

/de/tags

/es/tags

and I cannot set a fixed parent because of that, because the rootParent is not the same. 


My individual selector code:

return $page->rootParent->find("template=tag, sort=title, include=hidden");


But unfortunately adding a new tag works only when setting a fixed parent page with the parent-selector.

Is there a way around?

Posted (edited)

@ceberlin: just a guess, but have you tried get instead of find? Find returns PageArray, which could be the issue here. Get, on the other hand, always returns Page.

Edit: that didn't help at all. This isn't possible at the moment.

Edited by teppo
  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...