The Rule form: K2

(0 votes, average 0 out of 5)

7-cham-k2-form

1. Page Type

This control allows you to target every different page type within K2.

Options:

  • item.view  [standard item view page]
  • user.itemlist
  • user.latest
  • category.itemlist.nofeatured  [different types of category pages depending on whether they include featured articles or not]
  • category.itemlist.withfeatured
  • category.itemlist.onlyfeatured
  • category.itemlist
  • category.latest  [latest articles in a category]
  • tag.itemlist  [list of articles with a certain tag or tags]

2. Item id(s)

You can target particular K2 item pages by ID number, to use a certain template (or to make the rule SUCCEED). If you want to target more than one, enter the list of ID numbers separated by commas. You should generally also select "item.view" pages from the Page Type control if you are targetting item pages by ID.

3. Item tag(s)

You can target particular item pages by tag, to use a certain template (or to make the rule SUCCEED). If you want to target more than one, enter the list of tags separated by commas.

4. Category id(s)

You can target particular items by category, to use a certain template (or to make the rule SUCCEED). You can select multiple categories by using Ctrl-click (Windows) or Command-click (Mac). This control will make the rule succeed for category pages as well as item pages where the item is a member of that category, so you may wish to also restrict the page type using the Page Type control.

5. Ancestor Category id(s)

If your category hierarchy is more than 1 deep, you may wish to target all category item pages that are beneath a certain top-level or mid-level category.

That’s where this control comes in. It allows you to target any category or item.view page that descends from the specified categories.

Don’t be confused by the fact that this is called “ancestor” rather than “descendent”. The categories that you select here may be the parents or grandparents (etc) of the products that you are trying to target... therefore the box is called “ancestor category id(s)”.

e.g. your category hierarchy may look like this:

  • Widgets
    • Blue
    • Yellow
    • Green
  • News
    • International
    • Local
    • Sport

If you want to target everything in the News category and its subcategories, select News.
If you want to target everything in the News and Widgets categories and their subcategories, select both Widgets and News.

6. # attachments

This control allows you to target K2 items that have a certain number of attachments, e.g. "= 0" will SUCCEED if a K2 item is being displayed which has no attachments.

Options:

  • Ignore
  • =
  • !=
  • >
  • >=
  • <
  • <=

7. # comments (publ.)

The number of published comments in the currently-viewed K2 item. e.g. you can target K2 items that have comments (>0) or no comments (=0).

Options:

  • Ignore
  • =
  • !=
  • >
  • >=
  • <
  • <=

8. # comments (unpubl.)

The number of unpublished comments in the currently-viewed K2 item. e.g. you can target K2 items that have comments (>0) or no comments (=0). This could be useful to indicate to an editor/publisher that there are unpublished comments waiting for moderation.

9. Featured?

This allows Chameleon to target K2 items that are featured or that are not featured.

10. Images

This allows Chameleon to target K2 items that have an attached image or do not have an attached image. Note that this does not detect images inside the HTML of the K2 item, only images attached using the dedicated controls for attaching images.

11. Meta-desc & Meta-keywords

K2 items can have Meta-descriptions and Meta Keywords added per item. This control allows Chameleon to examine these values and make decisions based on them.

Options:

  • equals
  • contains
  • starts with
  • ends with
  • matches regex
  • does not equal
  • does not contain
  • does not start with
  • does not end with
  • does not match regex
  • is in list (comma-separated list of exact matches for the entire string)
  • is not in list (comma-separated list of exact matches for the entire string)

Regex values must include start and end delimiters e.g. #Joomla#

Example: you could switch to a different template by detecting all K2 items that "contain" the word Joomla in the meta-keywords.

12. Author username

This control examines the username associated as the author of the K2 item. It uses the same set of options as the meta description/keyword control.

13. Viewer=Author

This control detects whether the logged-in user is also the author of the currently-viewed K2 item. In this way, you can perform actions only when the user is viewing an item which s/he has authored, such as using a different template style.

Options: Viewer = Author (viewer is the author of the item) | Viewer != Author (the viewer is not the author of the item)

 

Last Updated on Monday, 06 October 2014 09:34