Jump to content

Is there a model (or tut) to use tags on PW?


tc_855
 Share

Recommended Posts

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • 3 months later...
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?

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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