The Publishing Assignments tab in the template edit view contains an enormous amount of assignment types and options.
By using the assignment options, you can determine where a template is available, either via the editor buttons or when automatically loaded.
This way you can - for example - create templates only for certain user groups. Or only available during certain seasons. Or only within certain extensions (components).
Matching Method
You can use and combine any of the assignments. You don't have to just use one.
To control how multiple assignments are applied, there is a Matching Method option. This determines whether all or any assignments need be matched:
- ALL: Will be published if ALL of the below assignments are matched at the same time.
- ANY: Will be published if ANY (one or more) of the below assignments are matched at any time.
Assignment groups where "Ignore" is selected will be ignored.
Note: When setting any or more assignments to Exclude, the Matching Method should be set to ALL. Otherwise, using ANY would result in one Exclude condition to always match and the content template to show everywhere else.
Show Assignments
You can select whether to show the full list of available assignments or only the selected assignments that are currently used. You can use this to get a clear overview of the active assignments.
When set to Selected, all not-selected assignment types will be hidden from view.
Assignment States
Each assignment type has three possible states/options.
- Ignore (default)
- Include: the content template will be assigned to all pages/circumstances that do match that assignment
- Exclude: the content template will be assigned to all pages/circumstances that do not match that assignment
By default all assignments are ignored, meaning the content template is not limited by assignments.
To use an assignment, you set the option to Include or Exclude depending on the desired effect.
Below you find all the available assignments with the respective settings for each.
Menu Items
In addition to the core Menu Items selection, it's possible to automatically include or exclude all current and future menu items placed under a parent menu item.
Selection | Select the menu items to assign to. |
Also on child items | Also assign to child items of the selected items? |
Include no Itemid | Also assign when no menu Itemid is set in URL? |
Date & Time
The date and time assignments use the date/time of your servers, not the ones of the visitor's system.
The date range can be set to be recurring every year in the same time period.
Date
Start Publishing | Enter the date to start publishing |
Finish Publishing | Enter the date to end publishing |
Recurring | Select to apply date range every year. (So the year in the selection will be ignored) |
Seasons PRO
Selection | Select seasons to assign to. Options: Winter, Spring, Summer, Fall / Autumn |
Hemisphere | Select the hemisphere your website is located in Options: Northern, Southern, Australia |
Months PRO
Selection | Select months to assign to. Options: January, February, March, April, May, June, July, August, September, October, November, December |
Days of the week PRO
Selection | Select days of the week to assign to. Options: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday |
Time PRO
Start Publishing | Enter the time to start publishing. Format: 23:59 |
Finish Publishing | Enter the time to end publishing. Format: 23:59 |
Languages
The Languages assignment differs from the core in that it allows a selection of multiple languages.
Selection | Select the languages to assign to. |
Joomla! Content
Categories
Selection | Select the categories to assign to. |
Also on child items | Also assign to child items of the selected items? |
Page types | Select on what page types the assignment should be active. Options: Categories, Articles, Others |
User Group Levels
Selection | Enter the user groups to assign to. |
Match all | Select to only let the assignment pass if all of the selected items are matched. |
Also on child items | Also assign to child items of the selected items? |
Users PRO
Selection | Select the users to assign to. |
Components
Selection | Select the components to assign to. |
Templates
Selection | Select the templates to assign to. |
URL
The URL assignment allows control over specific pages or groups of pages, with support for Regular Expressions.
URL matches | Enter (part of) the URLs to match. Use a new line for each different match. |
Use Regular Expressions | Select to treat the value as regular expressions. URL parts will be matched using regular expressions. So make sure the string uses valid regex syntax. |
Case Sensitive | Url parts will be only match if casing is exactly the same. |
Devices
Selection | Select the devices to assign to. Keep in mind that device detection is not always 100% accurate. Users can setup their device to mimic other devices. Options: Desktop, Tablet, Mobile |
Operating Systems
Selection | Select the operating systems to assign to. Keep in mind that operating system detection is not always 100% accurate. Users can setup their browser to mimic other operating systems. |
Browsers
Browsers | Select the browsers to assign to. Keep in mind that browser detection is not always 100% accurate. Users can setup their browser to mimic other browsers |
Mobile Browsers | Select the browsers to assign to. Keep in mind that browser detection is not always 100% accurate. Users can setup their browser to mimic other browsers |
IP Addresses PRO
IP Addresses / Ranges | A comma and/or enter a separated list of IP addresses and IP ranges. For instance: 127.0.0.1 128.0-128.1 129 |
Geolocating PRO
Geolocating is not always 100% accurate. The geolocation is based on the IP address of the visitor. Not all IP addresses are fixed or known.
To be able to use this assignment, you need to install the Regular Labs GeoIP library.
Continents | Select the continents to assign to. |
Countries | Select the countries to assign to. |
Regions / States | Select the regions / states to assign to. |
Postal Codes | A comma separated list of postal codes (12345) or postal code ranges (12300-12500). |
Custom PHP PRO
This gives you the opportunity to assign to just about anything you can think of. You just need to know what PHP code you should use.
With PHP you can call on all data/information available in the variables, URL, database, etc. And then do your checks on this data. You can control the display by ending the PHP code with a return true or false based on your checks.
For examples and ready-to-use PHP scripts, check out the "Using Custom PHP Conditions" guide.
Custom PHP | Enter a piece of PHP code to evaluate. The code must return the value true or false. For instance: return ( $user->name == 'Peter van Westen' ); |