MAS:Template Tags
Tags for Section templates
Main (simple) content tags
The following tags are available to pull the main properties of content sets which are directly included in the given section and matching the section's category.
The symbol # has to be replaced with a number, showing the order in which sorted content links are placed on the page ([ahref1], [ahref2], ..., [ahref10]
etc.), unless the code is included in a loop structure. Content sets may be sorted according to their popularity (number of views), rating, date of update or alphabetical order - whatever sort order is defined in the section.
The same tags are also available for Search Results and _Favorites templates.
-
[ahref#]
-- the link URI to the content set's gallery page.
-
[imgsrc#]
-- the image URL of the content set's face image (main thumb), relative to the current directory.
-
[galimage#]
-- like[imgsrc#]
but returns the bigger version of the face image, a.k.a. the gallery image.
-
[name#]
-- the Name (title) of the content set.
-
[description#]
-- the Description of the content set (html code is not allowed, new lines are ignored).
-
[longdescription#]
-- the Long Description of the content set (html code is allowed, new lines are ignored).
-
[shortdescription#:xx]
-- the Description limited to XX characters (truncated to a whole word) followed by ellipsis... Examples:[shortdescription1:100]
,[shortdescription_new1@*5:120]
-
[date#]
-- the date at which the content set has become active (publish or activation date).
-
[shortdate#]
-- like[date#]
but using a different date formatting. The default format is Jan, 2012 but both can be configured globally through Preferences.
-
[views#]
-- a number indicating how many times this content set has been viewed by members for the last stats period (30 days by default).
-
[rating#]
-- the current rating based on user votes (from all members for all times) for the content set.
-
[nrvotes#]
-- the number of times the content set has been rated (unique per member).
-
[path#]
-- the relative filesystem path to the folder containing the content files (e.g. content/path/to/set/image.jpg). It can be used for example inside an<img>
element to reference additional images uploaded with the content. Check the advanced options for face images for more info. Example:<img src="[path1]thumbs/title.gif" />
.
- In the case of leased content, this tag returns the external URI of the leased feed.
-
[lid#]
-- the unique ID of the content set in the MAS database
-
[category#]
-- the category of the content set. Especially useful in the extended tags form (e.g.[category_new#]
) and when used in combination with category and master-category dependant tags.
- For example
[ahref_new1@*6] [name_new1@*6]
will give the link and the title of the newest content set in master category *6, while[category_new1@*6]
will print the actual category (regular, not master) of the content set found (for ex.: Photo - Amateurs). - Most often used at home pages to show the category of the newest/upcoming/top rated sets displayed. But also useful in cases of regular sections that include content from more than 1 categories and inherit common templates - which is common for multi-site network setups.
-
[duration#]
-- the Duration field of the content set. Duration is not calculated automatically for videos, it is a plain text field - so, you are allowed to enter an arbitrary text in that field (20'45", 20 min 45 sec, 1 hour 20 min etc.) and it will be outputted as-is.
-
[nrpics#]
-- the number of image files present in a content set. If the content set is a group, then this tag returns the sum of image files found in all of the content sets part of that group.
-
[nrvids#]
-- the number of video files present in a content set. If the content set is a group, then this tag returns the sum of video files found in all of the content sets part of that group.
-
[nrsets#]
-- the number of content sets included inside a content group. If the current set is not a group, this tag would return 1.
-
[nrphotosets#]
-- the number of photo sets included in a content group. A content set is considered to be a photo set if it contains more than 10 image files.
-
[nrvideosets#]
-- the number of video sets included in a content group. A content set is considered to be a video set if it contains at least one video file.
-
[nrcomments#]
-- the number of approved comments the content set has.
-
[nrfavorites#]
-- the number of users which currently have this content set added to their favorites, within the current site.
-
[addfav#]
-- link adding the content set to user's Favorites (example:<a href="[addfav#]">+ Add to favorites</a>
)
-
[delfav#]
-- link removing the content set from user's Favorites (example:<a href="[delfav#]">X</a>
). This tag is available only in _Favorites templates.
-
[relref#]
-- link URI to the content set related with the current one. The relation is set through the Edit Content Set form. (An example of related sets is a video set, related with a picture set containing captures from the video). Use this tag inside an <a> element. If a related set has not been defined, the whole<a href="[relref#]">......</a>
element will be removed.
-
[relimg#]
-- the URL of the face image of the related set (if any). Usually in combination with[relref#]
like in this example:
-
<a href="[relref1]"><img src="[relimg1]"></a>
-
[relpath#]
-- the path to the related set's content folder.
-
[rel.nrpics#]
-- the number of image files present in the related set (if any)
-
[groupref#]
,[groupname#]
,[groupimg#]
-- these tags are used to return a reference to the parent content group of the currently processed set, respectively they give the link, title and faceimage. Most typically - a reference to the model featured in the current set.
- If the content set is part of more than 1 content groups, then ANY of them is chosen without a given rule.
- If the set has no content groups, the html code inside the
[groupref#]
link will be removed without triggering<!-- start_link --> .. <!-- end_link -->
to strip the whole set. - Example:
This scene: <a href="[ahref_new1@16]">[name_new1@16]</a><br /> Featuring: <a href="[groupref_new1@16]"><img src="[groupimg_new1@16]" />[groupname_new1@16]</a>
-
[parents#]
-- generates a comma-separated list of links to all parent groups the content set is included in. The parents are not sorted in any particular order. The typical use of this tag is when content sets are organized by models - then it would return the links to all model group pages.
-
[gallery#]
-- generates a php include that nests the whole contents of the gallery page into the home/section page. Useful for cases where the gallery page itself does not contain much information and is better to be skipped as a standalone page in the pageflow, but be displayed inline. Typically used in reality-style layouts.
-
[rate#]
-- similarly to the[rate]
tag for gallery templates, this one inserts a rating bar (boxes or stars) directly at the section page. This might require a more careful setup of the rating stars layout first (and the used layout may be different than the one used at the gallery page. Our recommendation is to allow rating only from the gallery page since this is where members come to see the content, otherwise they are casting a blind rate.
-
[attribute.attrname#]
-- the values of the attrname attribute assigned to this set. See Attribute tags for more details.
-
[seoname#]
-- the SEO-friendly URL identifier of the content set (the value of the Seo-name (url) field as defined for the set, followed by slash and the content ID). To be used instead of[ahref#]
for sites (tours) that have been especially configured with aux files for SEO. Example:<a href="videos/[seoname#]">[name#]</a>
Removal of HTML code blocks containing non-substituted tags
-
<!-- start_link --> ... <!-- end_link -->
- (optional) Enclose a whole group of tags for a single content set, including any other html layout elements/graphics, between these 2 comment lines. This way if no more content sets are found to replace these tags, the whole html code fragment falling between these comment lines will be stripped, avoiding the display of empty placeholders (e.g. on the last page).
These comment lines may be used with the extended tags too. Also available for Gallery Templates, Search Results and _Favorites (but not for Hi-res Contaner Templates).
- IMPORTANT: The
<!-- start_link --> ... <!-- end_link -->
block structure will be triggered (and the whole enclosed code removed from the page) if:- there is a single unsubstituted tag of any kind in between
- there is not enough content to substitute all the tags inside
- there is a syntax error (non-existing MAS tag)
- you have used square brackets
[...]
. Sometimes you might need to use javascript or php code with arrays, which do require square brackets notation, or you might simply want brackets as part of the design. In these cases workaround solutions are to be sought so that the brackets are properly escaped and not trigger the start-end_link block.
- One such workaround, currently available only to gallery templates and subtemplates is to prepend your brackets (not the ones that are part of MAS tags) with backslashes
- (e.g. instead of array['key'] use array\['key'\]
- Tip: If you are seeing that your content is not displayed on the page (stripped by start-end_link) but it should be there, then troubleshoot by temporarily renaming
<!-- start_link -->
to something else (e.g.<!-- xtart_link -->
) by using a global Find & Replace in your template editor, then rebuild the page and search to see where is the left bracket. After correcting the mistake, you will be able to quickly replacextart_link
back tostart_link
and restore the template.
Example:
<!-- start_link --> <p><a href="[ahref1]" class="face"><img src="[imgsrc1]" border="1"><br /> <font size="+1"><b>[name1]</b></font>([views1])</a><br />[description1]<br /> Added: <i>[date1]</i></p> <!-- end_link -->
The additional HTML tags and properties above are NOT necessary - used here just to illustrate the freedom to to use the custom tags throughout any existing HTML code.
For most tags it is not even necessary to insert them in HTML Code view of a text editor - but they could be typed-in in WYSIWYG (visual) mode of editors like Dreamweaver etc.
Extended (sorted) content tags
A variation of most of the main tags explained above can be used to display the latest updates _new#
, the upcoming updates _next#
, the most-viewed sets _top#
, the top-rated ones _rated#
or random ones _random#
.
Almost all of the simple tags have a corresponding extended form, created by inserting the extended tag group after the simple tag name and before the number (or #hash sign).
For example [ahref#]
would become [ahref_new#]
or [ahref_top#]
etc.
A noteable difference between the extended and the simple tags is that if, for example, you have configured a section to be sorted by popularity and use the simple tags, the content sets that will be displayed (called through the main tags) are only these ones that match the section's category and that are explicitly set to be included in it. Whereas the sets called through the extended tags are taken from the pool of all active content sets that are included in any section within the current site (members or tour area). Therefore it is common that sections using only extended tags are assigned the system [home] category and do not have any content sets directly included.
Their sole purpose is to help automate the index (main) page of the site, providing sorted top links to ALL the included categories, without a need to link all content sets to the index page. Simply create a members area section page, name it something like "Home", "Index", etc., paste a template that uses the extended tags plus links to the categorized section pages, and you have an dynamically changing index page.
IMPORTANT! The extended tags may only have the # symbol replaced with a limited number from 1 to 15 (this upper limit can be configured through Setup > Preferences menu. This restriction does not apply to the simple tags, which may have unlimited number count as #.
Another difference is that the extended tags do not span over multiple pages, like the simple ones do. They will only appear on the first page of a section and will not generate next pages.
Here are some examples:
-
[ahref_new#], [imgsrc_new#], [name_new#], [description_new#], [date_new#], [views_new#], [rating_new#], [relref_new#]
- this set of tags is very similar to the simple tags described above, but the difference is that these ones will be replaced with links to the newest updates, ordered by the number specified with #. You can use these tags on the home page of your members area to create a section "WHAT'S NEW" and provide your members with direct image-and-text link to your freshest content.
-
[imgsrc_next#], [name_next#], [description_next#], [date_next#]
- in addition to the _new# tags, this group allows you to create a section "UPCOMING UPDATES" to show your members that the site is growing. The tags will be replaced with the nearest next updates which are set up with future date. Note that there are no[ahref_new#], [relref_new#], [views_new#], [rating_new#]
tags, since noone is expected to follow a link to a future update, nor upcoming updates are expected to have a non-zero rating or views counter.
-
[ahref_top#], [imgsrc_top#], [name_top#], [description_top#], [views_top#], [rating_top#], [relref_top#]
- this group allows the creation of a section "TOP 10 (Most Visited Links)" which you can place on your members area index page.
-
[ahref_rated#], [imgsrc_rated#], [name_rated#], [description_rated#], [views_rated#], [rating_rated#], [relref_rated#]
- this group allows the creation of a section "TOP 10 (User's votes)".
-
[ahref_random#], [imgsrc_random#], [name_random#], [description_random#], [views_random#], [rating_random#], [relref_random#]
- this group allows displaying random content sets (often for simulating a Pic of the day feature). The displayed sets will be changed every time the section is rebuilt (if not manually, then at least 4 times a day with the automatic rebuilding of all sections). MAS ensures that the random sets displayed on one page with different random tags will be unique (i.e.[name_random1]
and[name_random2]
will never display the same one. However[name_random1]
might become the same as[name_new1]
.
All of the extended tags also have a category-dependant form - like
-
[ahref_new#@cid]
... where cid is a category ID. Use this form, if you want to list items from a particular category. For example, if the category ID of the video scene updates for the site you work on is 4, then[ahref_new1@4]
will produce the URL to the latest scene,[name_new1@4]
will be its title;[name_new2@4]
would be the title of the 2nd newest update, and so on.
For the cases where master categories are used, all extended category-dependant allow specifying the ID of the master category prefixed with an asterisk, instead of the single category ID.
-
[ahref_new#@*mcid]
- for example, if 4 is the single category ID of "HD Scenes", and 5 is the single category ID of "SD Scenes", and both categories are made part of master category "Video Scenes" with a master ID of 2, then[ahref_new#@*2]
will be populated with the latest updates from either HD or SD scenes.
Common section-specific tags
-
[masurl]
-- the URL of the MAS installation, in case it's needed to refer to common files (js/css/images) stored there. Available in all templates and subtemplates.
-
[masroot]
-- the root-based filesystem path of the MAS installation, in case it's needed to php-include specific files (e.g. external libraries stored in [masroot]/public/). Available in all templates and subtemplates.
-
[sitename]
-- the actual name of the site, as defined through the Edit Site form. You can use this tag more than once in a single template - for example inside the<title>
tag in the html head, or in the body or footer area, as a part of a welcome or copyright text. This tag applies to all kinds of templates except Hi-res Contaner templates.
-
[sectionname]
-- the name of the current section.
-
[category]
-- the category of the current section. Useful when the same template is reused with multiple sections (from various categories).
-
[sid]
-- the section ID in the MAS database.
-
[query]
-- (available for Search Results templates only) -- the keywords being currently searched. Example:Search results for: [query]
-
[favorites]
-- the link to the My Favorites page (use this in main site navigation, e.g.<a href="[favorites]">My Favorites</a>
)
-
[delfavorites]
-- (available for _Favorites templates only) -- link to remove all favorites (for the logged in member). Example:<a href="[delfavorites]">Clear all</a>
-
[join]
-- shorthand for<?=$JOIN;?>
- the php variable containing the URI of the join(signup) page. The variable itself must be assigned a value earlier in the template (or in common header section included above).
Content counters
-
[nrpics]
,[nrvids]
,[nrsets]
-
[nrpics@cid], <code>[nrvids@cid]
,[nrsets@cid]
-
[nrpics@*mcid], <code>[nrvids@*mcid]
,[nrsets@*mcid]
- These tags display counters of all content present on the site, globally or per category (cid) or master category (*mcid).
- Note: Content Groups are not counted!
-
[nrsets.section]
-- the number of content sets (including content groups) included in the current section.
- It works with the
[InheritContentFrom:...]
clauses too, and with the limitations invoked by[LimitByAttribute:attrname=attrvalue]
clauses as well.
News, Events, Polls, Feedback tags
-
[news#]
-- will be replaced with the actual news, as defined through the News menu. The news are ordered by date in descending order (the newest ones first). You may use this tag in a members area section template - the best place for it is the home page, where you can put just one [news1] tag, or you can make a separate section, which displays more news (including old ones; up to 100), and link to it from the home page.
- News will be displayed in the following format by default (which is configurable through MAS:User Preferences and is global for all sites):
-
<p><b>%subject%</b><br/><i>(%date%)</i><br/>%body%</p>
Subject
(yyyy-mm-dd)
Message body. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
-
[shortnews#]
-- is an alternative to[news#]
. It is used in absolutely the same way, but is using a different formatting for the output. By default, only the message body will be displayed, but it can also be changed through global preferences. The date formats for both[news#]
and[shortnews#]
can be configured globally too.
-
[event_past#]
-- like[news#]
, but pulling from the Events list. This tag displays only current and past events (with date <= today);[event_past1]
being the current event,[event_past2]
the last one before it, and so on.
-
[event_future#]
-- upcoming events (with date set in the future)
-
[event_timeleft]
-- displays static time left until the next scheduled event ("HH hours MM minutes left", or "Live for MM minutes", or "Event closed"). The output value will refresh with refreshing the page in a browser, does not require rebuilding of the section.
-
[event_countdown]
-- displays a ticking countdown box in format "DD days HH hours MM minutes SS sec". Days and Hours are not displayed if zero.
- When the event is live, the box displays "NOW LIVE!", or "No more events" if there is nothing scheduled.
- This tag is producing a text input box using CSS class="event_countdown" which can be defined to control its appearance.
-
[event_status]
-- returns "past", "live" or "future". This one can be used inside an image source, as part of the filename, to visually display different flags/images based on the status of the next event(show).
- For example, you may have the following images: images/event_past.gif, images/event_live.gif, images/event_future.gif,
- and use template code like:
<img src="images/event_[event_status].gif" />
-
[calendar]
-- generates a dynamic calendar showing past and upcoming events. In version 2.0 it can also pinpoint all content updates as automatic entries. See MAS:Events_Calendar for more info on usage and styling.
-
[feedback:email@domain.com]
-- this tag is for creating a contacts/feedback page. The best way is to create a separate members area section page and include the tag in it, replacing email@domain.com with the actual email address where you will want to receive feedback from your members.
-
[poll]
- this tag will print the currently active poll if there is one configured for this site. The first time the page is viewed, the question and the available options will be shown. After the member clicks the submit (vote) button, the page will refresh and the same place occupied by the[poll]
tag will show the current poll results in a bar graph.
The layout of the displayed feedback form and the poll questions and answers can be controlled by defining CSS styles.
Special clauses to Inherit templates and included content, Limit content by condition
-
[include:sectionname]
-- include the parsed contents of the section named sectionname (which is part of the current site) into the current one. You may use as many such includes in each template as needed. The text after the colon is the name of the section to include, but written in lowercase, and with all spaces and punctuation removed (e.g. if the section's name is _Main Header 3 the tag should be[include:mainheader3]
.
- Widely used to include common site areas such as header and footer, navigation bars, and so on. Available to all kinds of templates (except Image Container)
-
[InheritFrom:sid]
-- This is a special clause to replace the whole template. Useful for cases where you have multiple sections, within a single or different sites, that are sharing absolutely the same template html code but only the included content sets/category/site are different. This allows only one template instance to be edited when needed (the master), and all other sections inheriting that template will update along with it.
- sid must be the Section ID containing the actual template (the master).
-
[InheritReplace:from1->to1;from2->to2;...]
-- This is an optional clause that can be used in conjunction with[InheritFrom:sid]
in cases where minor replacements need to be made in the inherited template before being parsed and populated with content within the current section. A good example is when you are inheriting a template having category-dependant tags (e.g.[ahref_new1@6]
) and you want to keep the template the same but only change the category to 8. In that case you would use[InheritReplace:@6->@8]
. The clause works with either one or many from->to pairs.
-
[InheritContentFrom:sid]
-- Similar to[InheritFrom:sid]
, but instead of inheriting sid's template, this clause tells MAS to inherit the list of content sets included in Section ID [sid], while the current section could be of any category and without any content sets directly included in it. This technique is useful in cases when there are many different sections that must show the same content sets in different ways (with different templates) but you want to avoid the confusion having to include content sets in more than 1 section.
-
[InheritContentFrom:sid,sid,.....]
-- An extension to the above, but allowing a single section to inherit the content sets included in more than one other sections, even if they are from different categories! Essentially, this provides the opportunity to create a regular multi-page section (not using the master category extended tags) which lists content from more than one categories. You still need to have separate sections (but could be blank ones, placeholders) for each of those categories and include the respective content in them, then you list the IDs of those sections in the inherit clause (e.g.[InheritContentFrom:5,25,3]
)
- Also note that ALL of the sections you inherit content from must be within the same site (members or tour area) as the one where you're using this clause.
-
<!-- [LimitByAttribute:attrname=attrvalue] -->
-- This special clause may be used along with[InheritFrom:sid]
or with a normal template. It tells MAS to restrict the content sets that will substitute tags in the section template only to those ones matching the given attrname=attrvalue pair.
- Useful for cases where you have a lot of content sets from the same category, but differing in attributes (niches). Then you don't have to bother with manual selection and inclusion of content sets in sections, but you can include all sets in many sections and then use this clause to break them down by attribute (niche).
- The conventions for attrname=attrvalue are the same as the ones used with the Attribute tags. The attribute must be printable and its values must be defined as a fixed list (not custom).
- You could use a negation in the condition too. For example
[LimitByAttribute:attrname!=value]
will restrict the displayed content sets to the one that do not have attrname=value. - For complex content filters, more than one comma-separated name/value pairs can be given, and even combinations of multiple attrname=attrvalue and attrname!=attrvalue (attributes to match and attributes to exclude).
- There is one special case, if the attribute is defined to have (custom) values. Then
[LimitByAttribute:attrname=(custom)]
will restrict the included content sets to those ones which have any non-null value assigned to attrname, those which do not have that attribute assigned at all will not be displayed on the section.
Example:
[InheritFrom:5] [InheritContentFrom:5,25,3] <!-- [LimitByAttribute:fetish=leather] -->
-
<!-- [LimitByCategory:cid,cid,...] -->
-- This special clause restricts the content sets that will substitute tags in the section template only to those ones matching the given categories (one or more, separated by commas). It affects all extended tags,[attributelist...]
,[contentlist...]
and[optionlist...]
tags, as well as the counter tags[nrpics] [nrvids] [nrsets]
that display total count of content in the site, but does not affect the main (simple) tags (e.g.[ahref#]
).
-
<!-- [LimitByType:videos] -->
or<!-- [LimitByType:pictures] -->
-- This special clause tells MAS to restrict the content sets that will replace tags in the section template only to those ones having video files ([nrvids#] > 0), resp. having only image files ([nrpics#] > 0). For example, if you have content groups for models, and you create a special section including all models, but also having this clause in the template, it will display only the models having videos and not the ones having only pictures, or vice/versa.
- This modifier does not affect extended tags (
_new
,_next
...), only the main (simple) tags ([ahref#]
,[name#]
...)
-
<!-- [LimitByContentID:range] -->
-- This special clause restricts the content sets that will substitute any tags in the section template only to those ones matching the given range of content set ID's. range can contain any of the following terms, or a comma-separated list of more than one terms:- 235 - a single content set ID (235)
- 1000-2000 - an interval (all content sets between 1000 and 2000, inclusive)
- -100 - less than or equal (all content sets between 1 and 100)
- 200- - greater than or equal (all content sets with ID equal 200 or above)
- Complex example:
<!-- [LimitByContentID:-100,350,324,370,1000-2000,6500-] -->
- Like
[LimitByAttribute:...]
this clause affects all kinds of tags in the section, both simple and extended. - It also can be used in conjunction with the other
Inherit/LimitBy
clauses described above.
-
<!-- [SkipContent:x] -->
-- this is a special clause (optional), which if present once at the beginning of the template, instructs MAS to skip the first x content sets only from the first page of this section, using the currently selected sort order. One example usage of this feature is when the newest update is displayed in a featured box at the top of the [home] page, then the "Previous updates" section must not include the newest one. If x=1, then[name1]
(on page 1) will refer to the 2nd content set included in the section, and so on.
- This modifier does not affect extended tags (
_new
,_next
...), only the main (simple) tags ([ahref#]
,[name#]
...)
Loops
-
{loop#:1:15}...subtemplate...{/loop#}
- This special tag construct can be used in any MAS section template, including Search Results and _Favorites. It means the following:
- - Repeat the ...subtemplate... code surrounded in this construct as many times as needed (15), and in each iteration replace the character identifier # with increasing values from 1 to 15, respectively.
So, as you often have repeatitive parts of html in templates listing content updates, for example
<a href="[ahref1]"><img src="[imgsrc1]" />[name1]</a> <a href="[ahref2]"><img src="[imgsrc2]" />[name2]</a> <a href="[ahref3]"><img src="[imgsrc3]" />[name3]</a> <a href="[ahref4]"><img src="[imgsrc4]" />[name4]</a>
you could replace all of this with:
{loop#:1:4} <a href="[ahref#]"><img src="[imgsrc#]" />[name#]</a> {/loop#}
and you may have as many loops within the same template as needed. The loop identifier character must not necessarily be #, but it is important to close the tag with the same character that has been opened.
Examples:
{loop%:1:10}.....{/loop%}
- correct
{loop%:1:10}.....{/loop#}
- wrong
That way, by using different identifiers, you may even have nested loops, e.g.
{loop%:1:4} ...some code iterating over %... {loop$:1:10} ...some code iterating over $... {/loop$} ... {/loop%}
Tip: If your HTML markup is made so that there's a piece of code which repeats periodically but not with every loop, for example a row separator, you could do the trick with a bit of php code comparing the current value of the loop identifier against a number (or a modulus). See the next example which displays 30 updates, 5 in a row, and each row is contained within a div:
{loop#:1:30} <?=((# % 5 == 1) ? '<div class="row clearfix">' : ''); /* This opening tag will show on loops 1, 6, 11, 16 ... */ ?> <!-- start_link --> <div class="updatebox"> <a href="[ahref#]"><img src="[imgsrc#]" /></a><br /> <a href="[ahref#]">[name#]</a> </div> <!-- end_link --> <?=((# % 5 == 0) ? '</div>' : ''); /* This closing tag will show on loops 5, 10, 15, 20 ... */ ?> {/loop#}
Pagination tags
(Common to all templates except Image container gallery templates, unless specified otherwise.)
The following tags are for use in pages which are not long enough to hold all of the included content sets. Tags apply to section templates (including special ones like Search Results and _Favorites) and gallery templates. Container templates only accept [prevpage]
and [nextpage]
.
-
[prevpage]
,[nextpage]
-- the URI of the previous/next page. If there are no more pages at the specified direction, MAS will delete everything inside the<a href=..... </a>
element (making the link to disappear).
-
[firstpage]
,[lastpage]
-- the URI of the first/last page. If the current page is the first one, MAS will delete everything inside the<a href="[firstpage]">..... </a>
element (making the link to disappear), respectively if the last page is current, the[lastpage]
tag would be removed.
-
[nextpage:URL]
-- where URL can be any fully qualified or relative page URL, which will be used by MAS in case the last page in a section is reached.
- This tag applies only to section templates and is most often used for tours.
-
[pages]
-- generates direct page links to all available pages, like this: « 1 2 3 [4] 5 6 »
- This is a standalone tag, not an URI - do not use it like
<a href="[pages]">
-
[pages.short]
-- like[pages]
but does not display all pages but only the first 4 / previous 3 / current / next 3 / last 4. For example, if there are 37 pages and the current page is 20, the output would be « 1 2 3 4 . . . 17 18 19 [20] 21 22 23 . . . 34 35 36 37 »
- The number of first/prev/next/last pages to display can be configured globally for all sites and templates through Preferences
-
[pages.select]
-- generates a dropdown list (<SELECT name="MAS_pages" class="pages_select">) populated with all available pages as options, the current page being selected. Changing the value of this dropdown immediately goes to the chosen page (without need for forms and submit buttons).
-
[pagenr]
-- displays the current page number.
-
[pageletter]
-- the currently selected letter page, if Break down by letter is enabled.
-
[pages.total]
-- the max. number of pages within the current section (or search results)
-
[pages.max=X]
-- This is a special tag that does not output anything, instead it works as a modifier to all the other pagination tags. When placed inside a section template it instructs the rebuilding engine to not generate more than X number of pages, even if there are more. This is particularly useful when you want to have a section showing just 3 pages of top-rated updates, or the other common case is when used in a tour template to show just a few pages of updates to non-members, while the members area version will display all pages.
Examples:
Page [pagenr] of [pages.total] <a href="[prevpage]">PREVIOUS</a>[pages]
<a href="[nextpage:join.html]"><img src="next.gif" border="0"></a>
Multiple sort order
The following custom tags are available for templates of sections with enabled Multiple sort order, which provide the proper linking to the same section sorted in a given way:
-
[sortby:name]
(alias of[sortby:name_asc]
) -- sort by content set title, alphabetically in ascending order (A-Z) -
[sortby:name_desc]
-- sort by content set title, alphabetically in descending order (Z-A) -
[sortby:date]
(alias of[sortby:date_desc]
) -- sort by activation date, descending order (Newest first) -
[sortby:date_asc]
-- sort by activation date, ascending order (Oldest first) -
[sortby:top]
-- sort by Most Viewed, descending order -
[sortby:rated]
-- sort by Top Rated, descending order (user ratings)
There is also another group of similar-looking tags [style.sortby:....]
which is used to apply visual distinction of the currently selected sort order.
MAS will replace the [style.sortby:...]
tag corresponding to the selected sort order with "MAS_sortby_active" (to be used as a css style class name or div id), and all other style tags with "MAS_sortby"
Example:
<style type="text/css"> a.MAS_sortby { font-weight: normal } a.MAS_sortby_active { text-decoration:underline overline; font-weight: bold; background-color:#F7B124} </style> Sort by: <a href="[sortby:name]" class="[style.sortby:name]">Title A-Z</a> | <a href="[sortby:name_desc]" class="[style.sortby:name_desc]">Title Z-A</a> | <a href="[sortby:date]" class="[style.sortby:date]">Newest first</a> | <a href="[sortby:date_asc]" class="[style.sortby:date_asc]">Oldest first</a> | <a href="[sortby:top]" class="[style.sortby:top]">Most viewed</a> | <a href="[sortby:rated]" class="[style.sortby:rated]">Top rated</a> <br /><br />
Since MAS version 2.0 these tags are also available for Search Results templates.
Break down by Letter
The following special tag (subtemplate structure ) is available for templates of sections with enabled Break down by Letter to insert the links with the alphabet - linking to the respective pages within the section. There are 3 syntax variations:
- Syntax 1:
{letters} {/letters}
- Syntax 2:
{letters}.....[link].....[letter].....{/letters}
- Syntax 3:
{letters}.....[link].....[letter].....{selected}.....[link].....[letter].....{/letters}
The first one is the most simple one - it will display the alphabet with no special styling, and the currently selected page (letter) will be enclosed in parentheses:
A B C D E (F) G H I J K L M N O P Q R S T U V W X Y Z
It is equivalent to using Syntax 3 with this code:
{letters}<a href="[link]">[letter]</a> {selected}<a href="[link]">([letter])</a> {/letters}
The more complicated form allows using any piece of html code (including <div>
or <td>
elements, styles, extra text etc.) to define the look of each letter in the alphabet. The tag [link]
gets replaced with the link to the respective page, [letter]
gets replaced with the letter.
And the difference between Syntax 2 and Syntax 3 is that 3 supports two different subtemplates to be used - the first one would be applied to all letters except the currently selected one, the second part after the clause {selected}
applies only to the currently selected letter.
Syntax 2 would use the same subtemplate for both parts.
There is no limit how many {letters}
tags to use in a single section, and they may carry different subtemplates each.
The use of the standard pagination tags [pages] [prevpage] [nextpage]
is unchanged, but they will display page links within the currently selected letter only.
If you wish to link to [all the letters of] the section that is broken down by letter from within another section, you can use the following php code, simply replacing XX with the section ID, and using different html for the links if needed:
<? foreach(range('a','z') as $ltr) print('<a href="show.php?a=XX_'.$ltr.'_1">'.strtoupper($ltr).'</a>'); ?>
uvar User-defined passthru variable
Besides its own variables and parameters that are exchanged in the page URI's when browsing a members area, MAS allows for one additional multi-purpose user-defined variable to "survive" and be automatically carried over to all other pages, generated through navigation links or through the [ahref],[relref],[groupref]
tags. It is most often used at tours to carry webmaster ref. codes, NATS codes etc., but it could be used for any other purpose.
The following tags are available in all templates, whenever the value of this user variable might be needed:
-
[uvar]
-- the value of&uvar
itself, if set.
-
[uvarpass]
-- the value of uvar, but formatted as a GET querystring, e.g. &uvar=value if value is not null, otherwise the tag returns an empty string. This tag is useful when you want to pass uvar to other pages in the site whose URLs are not generated by the navigation tags, e.g. the main menu. Example:
<a href="show.php?a=56_1[uvarpass]">Photos</a>
Tags for Gallery Templates
Common tags
-
[title]
-- the Name (title) of the content set. ([name]
does the same as[title]
, both are allowed.)
-
[description]
-- the content set's Description.
-
[longdescription]
-- similar to[description]
, but will be replaced by the Long Description defined for this set. Long descriptions may contain html code for formatting and external links and images. The long description text may even contain a tag[path]
which will be substituted with the path to the content folder in case it needs to refer to a thumbnail or preview image uploaded there.
-
[faceimage]
-- the URL of the face image for this set (gallery). This tag is typically placed inside an<img src="[faceimage]" />
element.
-
[galimage]
-- just like[faceimage]
but giving the URL of the different-sized gallery image for this set. Check the advanced options for faceimages for more info.
-
[path]
-- will be replaced with the filesystem path to the folder containing the content files, relative to the site's document root. It can be used for example inside an<img>
element to reference additional images uploaded with the content. Check the advanced options for faceimages for more info. Example:<img src="[path]thumbs/title.gif" />
-
[date]
-- shows the date at which the content set became active. The default date format is January 1, 2012 but it may be configured globally for all sites through Preferences and it may be diffferent than the format used to display dates in section templates.
-
[duration]
-- the Duration field of the content set.
-
[nrpics]
-- the number of image files present in a content set. If the content set is a group, then this tag returns the sum of image files found in all of the content sets part of that group.
-
[nrvids]
-- the number of video files present in a content set. If the content set is a group, then this tag returns the sum of video files found in all of the content sets part of that group.
-
[nrsets]
-- the number of content sets included inside a content group. If the current set is not a group, this tag would return 1.
-
[rel.nrpics]
-- the number of image files present in the related set (if any)
-
[addfav]
-- link adding the content set to user's Favorites (example:<a href="[addfav]">+ Add to favorites</a>
)
-
[rate]
-- inserts a rating bar (1 through 5) allowing the members to vote for this content set. The appearance of the rating bar is global for all sites and templates, although it could be altered through some CSS styles. Changing from the default layout of numbered boxes to highlighted stars is also an option.
-
[comments:XX]
-- inserts the user comments block. XX in the tag must be a number, indicating the number of latest comments you want to display. (For example:[comments:10]
). The tag will display the last XX approved comments, ordered by date/time, newest first, and a form for adding a new comment. If the gallery template is used in a non logged-in tour area, then the new comments form is not visible. See MAS:Members_Comments for more info about comments.
-
[attribute.attrname]
-- the values of the attrname attribute assigned to this set. See Attribute tags for more details.
-
[masurl]
-- the URL of the MAS installation, in case it's needed to refer to common files (js/css/images) stored there. Available in all templates and subtemplates.
-
[masroot]
-- the root-based filesystem path of the MAS installation, in case it's needed to php-include specific files (e.g. external libraries stored in [masroot]/public/). Available in all templates and subtemplates.
-
[levelup]
-- this tag provides a link to the section page including (listing) the current gallery (content set).
- Example:
-
<a href="[levelup]">BACK TO INDEX</a>
-
[relref]
-- link URI to the content set related with the current one. If a relation has not been set, the entire element<a href="[relref]">...</a>
will be removed.
-
[relref_clean]
-- same as[relref]
but without the code that removes the surrounding link element. Useful for cases where the link of the related set is about to be passed on to javascript code, etc.
-
[relimg]
-- the URI of the face image of the related set (if any). Usually in combination with[relref]
like in this example:
-
<a href="[relref]"><img src="[relimg]"></a>
-
[rel.include]
-- generates a php include function that directly includes the built HTML gallery code of the related content set (if present) into the code of the current content set.
-
[groupref]
-- used exclusively with content sets that are part of a content group. Placed inside an<a>
element, just like[relref]
, this tag will link back to the referring group page. If a parent group was not found the entire element<a href="[groupref]">...</a>
will be removed.
-
[parent#]
-- used exclusively with content sets part of a content group but only in cases where a content set has been made a part of more than one groups (i.e. it has more parents). This is a standalone tag, do not place it inside of an<a>
element like[groupref]
. It will output a text link with the title of the parent group.
- Here replace # with the ordinal number of the parent (max. 15):
[parent1]
,[parent2]
... - The order of parents is not defined (e.g. parent groups may be listed in any order without the user having control over it). If needed, the parent order can be defined through global config files, for all sites and templates.
- The exact HTML code being generated is controlled through the Content groups - parents subtemplate
-
[parents]
-- shows the links to all content group parents, separated by commas, and prefixed with a common word defined in global configuration (by default: "Featuring: "). Essentially this tag is equivalent to:Featuring: [parents1], [parents2], [parents3]...
except that it prints as many parents as there are indeed.
-
[parents@cid], [parents@mcid]
-- same as[parents]
, except that the displayed parent groups will be filtered by Category ID (@cid) or Master Category ID (@mcid). The common prefix ("Featuring: ") will not be applied.
-
[parents_array]
- initializes a php array $PARENTS with the id/title/faceimage/description/date/category of all groups that are parent of the current content set. The values of this array could be used later for more sophisticated, customized processing & display of the parents. Include this code at the beginning of the gallery template to see the returned values:
[parents_array] <?php print("<pre>"); print_r($PARENTS); print("</pre>"); ?>
Content tags
-
[content]
-- this is the main tag that displays a link to a content item (photo, video, etc.) inside the gallery page. The simplest use is to just put[content]
at every place where you want a linked thumbnail to appear (for example inside a table cell). Put as many[content]
tags in the gallery template as the number of thumbs you want to be visible on one page. If there are more content items (files) in the set than the number of tags used, then MAS will generate more pages (and you should consider using pagination tags).
The HTML code that [content]
produces varies depending on the type of content found.
- if the content is an image, produce a thumbnail image linked to the hi-res image container page;
- if a thumbnail is not found, the whole link to that file is skipped;
- if the content is a video, the filename and the filesize will be printed below the thumbnail;
- if the content is a text story, an icon will be shown and the filename printed next to it;
- if the current set is a content group,
[content]
will print the faceimage and beneath - the title (as a text link) of the child gallery.
The exact html code used for each type of content can be fine-tuned through the subtemplates (see below).
There are 2 special forms of the [content]
tag which can be used alone, or together with the simple form - extension-dependant and group category-dependant:
-
[content_ext]
-- where ext is the filetype extension being sought. This is particularly useful with video galleries, where clips in different formats have to be presented separately. For example[content_wmv]
will show the WMV videos,[content_mp4]
- MP4's,[content_mov]
- quicktime movies etc.
-
[content@cid]
-- this form is used in gallery templates for content groups, where you want to group the child sets in the group by type (pictures/videos, etc.). For this purpose, replace cid with the category ID of the type of content sets being sought. These IDs can be looked up at the MAS:Categories list.
-
[content@*mcid]
-- similar to the above, but using master categories. See the examples for[ahref_new#@*mcid]
at Extended tags for sections
-
<!-- [SkipContent:x,y] -->
-- this is a special clause (optional), which if present once at the beginning of the template, instructs MAS to skip x content items from the beginning of the gallery, and then y items after each[content]
tag. The feature is used exclusively with tours, when a slave gallery template (tour) is linked to a master template (members area). That way the gallery may show less thumbnails on the tour, than in the members area.
Subtemplates
The following tags may appear in subtemplates. Not all tags are applicable to all kinds of subtemplates - see the descriptions of available tags and default values to each subtemplate below.
Subtemplate tags for regular content sets
-
[directlink]
-- the URL of the content file.<a href="[directlink]"></a>
creates a link that when left-clicked, opens the content file with the default application associated with this file type on the client's computer; to download the user must right-click on it and choose "Save target as...". The download is served by the Apache web server and may be coming from a CDN server.
-
[view]
-- link URI to the container page, showing the selected content item as a high-res (or medium-res) image, or embedded video player. (<a href="[view]">
)
-
[download]
-- link URI to download the content file.<a href="[download]"></a>
creates a link that when left-clicked opens the "Save as..." dialog of the browser. The download is served by a php script on the local MAS server and cannot utilize CDN or media streaming functionality.
NOTE: When "[directlink]"
, "[view]"
or "[download]"
are enclosed in double quotes, the produced HTML will contain some additional php and JavaScript code. If you want to assign the URL of the content file to a php or JavaScript variable, use single quotes instead (e.g. <? $foo = '[directlink]'; ?>
)
-
[mediumlink]
-- (applies only to Images subtemplate). Same as[directlink]
but when the gallery template is set to use images resized to a medium resolution this tag returns the URL of the medium-sized image while[directlink]
gives the URL of the full-res one.
-
[thumb]
-- URL of the thumbnail image (<img src="[thumb]" />
)
-
[path]
-- the relative filesystem path to the content folder (e.g. content/path/to/gallery01/)
-
[filename]
-- the name of the content file, without path and extension (e.g. image01)
-
[ext]
-- the extension of the content file, with a leading dot (e.g. .mp4)
-
[extype]
-- the extension sub-type of the content file, when using files with multiple extensions, without leading or trailing dots. For example, if the file is scene1.mobile.low.mp4 the tag will return mobile.low
-
[filesize]
-- the size of the content file (e.g. 14.5 MB)
-
[filenr]
-- the serial number of the current file in the content set, as ordered by extension and filename (1,2,3...)
-
[partnr]
-- the serial number of the current file, but restarted for each [extype]
-
[masurl]
-- the URL of the MAS installation, in case it's needed to refer to common files (js/css/images) stored there. Available in all subtemplates.
Subtemplate tags for content groups - parent and child sets
Most of these tags follow the syntax and functionality of the Main content tags for sections - look them up for more information.
-
[link]
-- link URI to the content set's page
-
[name]
-- the name/title
-
[description]
-- the description
-
[shortdescription:xx]
-- the description limited to XX characters (truncated to a whole word) followed by ellipsis...
-
[longdescription] / [longdescription:xx]
-- the long description, optionally limited to XX characters
-
[faceimage]
or[imgsrc]
-- URL of the face image (both tags do the same, the second one provided for consistency with the syntax of section tags)
-
[galimage]
-- URL of the bigger version of the face image (a.k.a. the gallery image)
-
[date]
-- the activation date
-
[category]
-- the content set's category
-
[path]
-- the relative filesystem path to the content folder
-
[lid]
-- the ID of the content set
-
[gallery]
-- php include of the whole (child) content set's html code, inline in the current group page
-
[rating]
-- the user rating of the content set
-
[duration]
-- the duration field of the content set
-
[nrpics]
-- the number of image files present in a (child) content set.
-
[nrvids]
-- the number of video files present in a (child) content set.
-
[nrsets]
-- the number of content sets included inside a (child) content group.
-
[rel.nrpics]
-- the number of image files present in the related set linked to the child content set (if any)
-
[addfav]
-- link adding the content set (group-child) to user's Favorites
-
[attribute.attrname]
-- the values of the attrname attribute assigned to this set. See Attribute tags for more details.
-
[orderby:name|date|description|longdescription|mouseover|duration|path]
- if put inside the groups - child subtemplate this tag overrides the default sort order for the child sets listed inside the group. Sorting can be done alphabetically by either one of the listed fields, descending order for date and ascending for all the rest. Only one[orderby:...]
tag per the whole subtemplate is allowed, it is not possible to define separate sort orders for each conditional subtemplate per category.
Default Values
- Images
- This subtemplate is introduced in version 2.0. In versions 1.83 through 1.86 it can be modified by placing the subtemplate code surrounded by
{subtemplate_images}...{/subtemplate}
inside the Text subtemplate area. The feature is preserved in 2.0 for backwards compatibility, but the code defined in the designated Images subtemplate area has precedence. - Available tags:
[directlink], [view], [mediumlink], [thumb], [filename], [ext], [path]
- Default value:
- This subtemplate is introduced in version 2.0. In versions 1.83 through 1.86 it can be modified by placing the subtemplate code surrounded by
-
<a href="[view]"><img src="[thumb]" class="thumb" /></a>
-
- Videos
- Available tags:
[directlink], [download], [view], [filename], [filesize], [ext], [extype], [thumb], [path], [filenr], [partnr]
- Default value:
- Available tags:
-
<a href="[directlink]"><img src="[thumb]" class="thumb" /><br />[filename]</a> [filesize]
-
- Audio
- This subtemplate is deprecated in version 2.0 and can only be modified through config files.
- Available tags:
[directlink], [download], [view], [filename], [filesize], [ext], [extype], [path], [filenr]
- Default value:
-
<a href="[directlink]"><img src="[masurl]images/audioicon.gif" border="0" align="absmiddle" />[filename]</a> [filesize]
-
- Text
- Available tags:
[view], [filename]
- Default value:
- Available tags:
-
<a href="[view]"><img src="[masurl]images/texticon.gif" border="0" align="absmiddle">[filename]</a>
-
- ZIP
- Available tags:
[directlink], [download], [filename], [filesize], [path]
- Default value:
- Available tags:
-
<a href="[directlink]">[filename].zip</a> [filesize]
-
- Content Groups - Parent
- Available tags:
[link], [name], [description], [faceimage], [date], [path], [attribute.attrname]
- Default value:
- Available tags:
-
<a href="[link]">[name]</a>
-
- Content Groups - Child
- Available tags:
[link], [name], [description], [shortdescription:XX], [longdescription], [longdescription:XX], [faceimage] / [imgsrc], [galimage], [date], [category], [path], [lid], [gallery], [rating], [nrpics], [nrvids], [nrsets], [rel.nrpics], [duration], [addfav], [attribute.attrname], [orderby:...]
- Default value:
- Available tags:
-
[orderby:name] <a href="[link]"><img src="[faceimage]" class="thumb" /><br />[name]</a>
-
Conditional subtemplates
There is an advanced feature for using different subtemplates per each extension referred to in a [content_ext]
tag.
This feature is completely optional and the existing templates/subtemplates will not stop working without any modification.
The generic syntax of the conditional subtemplate (videos) is:
{subtemplate_ext1} html code and subtemplate tags to be applied in place of [content_ext1] tags {/subtemplate} {subtemplate_ext2} html code and subtemplate tags to be applied in place of [content_ext2] tags {/subtemplate} html code and subtemplate tags to be applied in place of all other [content] and [content_ext] tags not specified above.
A similar conditional syntax is also available for Content Groups - Sets subtemplate, where you can define a separate subtemplate for any category of the child content sets included in a group:
{subtemplate@cid1} html code and subtemplate tags to be applied in place of [content@cid1] tags; cid1 is the category ID of the child sets sought {/subtemplate} {subtemplate@cid2} html code and subtemplate tags to be applied in place of [content@cid2] tags {/subtemplate} {subtemplate@*mcid} html code and subtemplate tags to be applied in place of [content@*mcid] tags {/subtemplate} html code and subtemplate tags to be applied in place of all other [content], [content@cid] and [content@*mcid] tags not specified above.
Tags for Container Templates (hi-res images and embedded videos)
-
[image]
-- Use this tag inside an Image container template, to show the full-resolution image, in a container that also supports the slide show feature and with a filter for transition effect. If medium image size is enabled for this gallery template, this tag will display the medium-sized image, linked to the full-size image in a new browser window.
- The generated code may vary in different MAS versions and depending on what configuration is used, but in most cases it is like this:
-
<img src="content/path/to/gallery/image.jpg" class="fullimage" name="slide" id="slide" border="0" />
- Respectively, you may use the CSS class .fullimage to apply styles to the image box.
-
[story]
-- use this tag instead of[image]
in templates designated for text (stories) content.
-
[video]
-- use this tag instead of[image]
when you have your MAS configured to open videos in a container page with embedded player object. It will give the fully-qualified URL of the selected video.
- Another possible usage is to provide a video download link:
-
<a href="[video]">Right-click this link and "Save target as..." to download the video</a>
-
<?=$i;?>
-- while[image]
and[video]
tags result in html code and the content URL's are fully qualified (including http://domain.com/...), sometimes it is needed to obtain just the content path and filename as a string (in order to pass it over as additional parameters to a built-in player, or to perform conditional programming based on it). In such cases that php variable could be used directly in the template, it will return the relative path like content/path/to/gallery/image.jpg
-
[current]
-- the filename of currently displayed item, without the content path.
-
[title]
-- the name/title of the content set.
-
[prevpage]
,[nextpage]
-- similarly to the use of these tags in sections and gallery templates. Here they provide the URI's to the container pages showing the previous and next image or video.
- The usage is the same (
<a href="[prevpage]">PREVIOUS</a>
) however the text PREVIOUS (or the image) inside the<a>
element will not disappear when the first/last image or clip have been reached. Instead a dialog box will popup informing the member that this is the first/last image/video from this set.
-
[levelup]
-- URI back to the gallery page.
-
[slide_startstop]
-- creates a button for starting/pausing a slideshow with the images inside the gallery. Available only for photo galleries.
-
[slide_speed]
-- displays a dropdown list for selection from 5 predefined speeds for the slideshow.
-
[jumpto]
-- creates a dropdown list with all the images (videos) in the gallery providing a way for direct navigation inside the gallery without going back to the thumbnail page.
-
[jumpto(part_of_file_name)]
-- this extended syntax allows for different "jumpto" dropdown lists distinguished by high/low speed or any other file pattern. You may have more than one such tags inside the same template.
- Example:
-
[jumpto(.high.wmv)]
-- dropdown list with only these items in a content folder which contain ".high.wmv" as part of their file name. -
[jumpto(.low.wmv)]
-- dropdown list with the low speed videos.
-
- You may use whatever text you want as part_of_file_name, not surrounding it in quotes or any other separators or whitespace between the filter string and the enclosing parentheses. And you may use whatever number of
[jumpto]
tags variations in a template.
The layout of the [jumpto]
list and the slideshow elements can be controlled with CSS styles.
Attribute Tags
This pack of tags is used to pull information that has been entered in the database through Content Attributes which have been defined as Printable . A similar syntax is available to gallery templates and section templates, incl. Search Results and _Favorites, in the form of simple tags and also extended and/or category dependant ones.
-
[attribute.attrname#]
- - where # is the tag ordinal number 1,2,3,4 like
[ahref1], [ahref2], [imgsrc1], [imgsrc2]
and so on. - - attrname is the attribute you want to print, typed in lowercase, only with basic latin letters 'a'..'z' and numbers 0..9, no spaces, no punctuation.
- For example, if you want to display the attribute values for your attribute "Niche" for the first content set on the page, you would use
[attribute.niche1]
; - for attribute "Model Name", use
[attribute.modelname1]
; - for attribute "Brustgrösse", use
[attribute.brustgrsse1]
- here you completely omit the umlauted letter or other special characters!
- For example, if you want to display the attribute values for your attribute "Niche" for the first content set on the page, you would use
The attribute tags are available in all other combinations with the extended tags, as follows:
-
[attribute.attrname_new#], [attribute.attrname_next#], [attribute.attrname_top#], [attribute.attrname_rated#], [attribute.attrname_random#]
-
[attribute.attrname_new#@cid], [attribute.attrname_next#@cid], [attribute.attrname_top#@cid], [attribute.attrname_rated#@cid], [attribute.attrname_random#@cid]
MAS is replacing the attribute tags only for attributes marked as Printable at the Content Attributes list. If you try to print the values of a non-existing content attribute, or one which is not printable, the tag will be outputted unchanged, so that you will see your mistake.
Respectively, the tag to print attribute values at the gallery template is:
-
[attribute.attrname]
When MAS is displaying the attribute values it prints the attribute name (the way you have it defined in the MAS admin) in bold, followed by a colon and the comma-separated list of all values being assigned to the content set (the system allows more values for the same attribute; the custom values will be printed too, if found). If the current attribute has not been assigned to a set, nothing is printed.
Example: Niche: amateur, fetish, teen
Whether or not the attribute name will be displayed in front of the values is determined by a global config variable defaulting to:
<b>%name%:</b> %values%<br />
Newer versions of MAS display only the comma-separated list of values by default, i.e. the above variable's default value has been changed to
%values%
which allows content attributes to be used for various purposes, including storing and pulling external links associated with each content set (e.g. model's own site), whole pieces of html code (e.g. the code for an iframe with cam software) and so on.
Content List, Attribute List, Option Lists
-
[optionlist_attribute:attrname]
-- this special tag is available to section templates to populate a dropdown list (select element) with all available attribute values, in order to visually assist search forms. The conventions for attrname are the same as for the[attribute.attrname]
tags, and the attribute being sought must be Printable. The list will contain only attributes, assigned to content sets which are included in the current site and are active - this way ensuring that a search for that attribute will return results.
Example:
<form name="searchform1" action="search.php" method="post"> <!-- You have to replace these hidden values with your actual ones --> <input type="hidden" name="sid" value="19"> <input type="hidden" name="ref" value="1"> <input type="hidden" name="at" value="0"> <select name="av[]"> <option selected value="">any</option> [optionlist_attribute:haircolor] </select> </form>
-
[optionlist_customattribute:attrname]
-- similar to the above, except that it is not listing attribute values defined as fixed options, but the ones defined as (custom) values.
Example:
<form action="search.php" method="post" name="BrowseByCustomAttribute"> <input type="hidden" name="sid" value="5"> <input type="hidden" name="ref" value="1"> <input type="hidden" name="at" value="0"> <input type="hidden" name="categories" value="25"> <!-- optional limit by category --> <select name="q" style="width:150px"> <option value="">---------------------</option> [optionlist_customattribute:keywords] </select> <input name="imageField2" type="image" class="gobutton" src="images/go.gif"> </form>
-
[optionlist_content@cid]
-- populates a dropdown list with the links to content gallery pages of all content sets matching the given category id cid, listed by name. It does not need to be inside a search form but anywhere on the page. Most often used to display all models in the site.
Example (includes an optional JavaScript function for immediate jump to the selected option):
<script type="text/JavaScript"> function jumpTo(where) { var selObj = where; var jumpLocation = selObj.options[selObj.selectedIndex].value; if (jumpLocation) { document.location = jumpLocation; return true; } else { return false; } } </script> <select name="SelectTitle" style="width:150px" onChange="jumpTo(this)"> <option selected="selected" value="">---------------------</option> [optionlist_content@22] </select>
-
{attributelist:attrname@Letter}....[searchlink]...[value]...{/attributelist}
-- This is a special subtemplate construction that will print out all existing attribute values in the site, eventually breaking them down by letter. For example, if you have assigned model names as attributes (not as content groups), this construction can be used to create a page listing all available models, alphabetically, grouped by first letter; and the displayed values (model names) can be links to the dynamic search function.
Generic syntax:
-
{attributelist:attrname}subtemplate{/attributelist}
or -
{attributelist:attrname@L}subtemplate{/attributelist}
- attrname is the attribute name, lowercase, same like in
[attribute.attrname]
tags - @L is optional, L is the starting letter. If used, the tag would return only attribute values starting with the given letter.
- @# would return attribute values starting with any number
- If @L is omitted, the tag would print all attribute values, sorted in alphabetical order, regardless of their starting letter
- subtemplate is optional too, it is the code which will be used when printing every attribute value. It must contain two tags:
- *
[searchlink]
- will be replaced with a call tojavascript:search(attribute_value)
; thesearch()
function must be defined separately in the template or the site header - *
[value]
- will be replaced with the attribute value (to be printed) - *
[cvalue]
- same as[value]
, but this one should be used in case the value might be coming from an attribute with custom values and it will be used to populate a search field (checkbox/radio button) in a search form.
- *
- If subtemplate is omitted, it would be assumed to be
<a href="[searchlink]">[value]</a>,
The following example will display the attribute values of attribute "Model", starting with A, as list items:
<li class="listHeader"><a name="A"></a>A</li> {attributelist:model@A}<li><a href="[searchlink]">[value]</a></li>{/attributelist}<br /><br />
The javascript search()
function is standard, as explained here in greater details: MAS:Search:
<script type="text/javascript" language="javascript"> <!-- // *** The following function provided by Mansion Productions. Part of MAS *** function search(what) { var SearchPageID = 19; // Replace this with the actual ID of the the search results template var HomePageID = 1; // Replace this with the actual ID of this members area section var SearchAt = 2; // 0 - attribute values only; 1 - name/description only; 2 - both eval("self.location='search.php?q="+what+"&sid="+SearchPageID+"&ref="+HomePageID+"&at="+SearchAt+"'"); } // --> </script>
And the following piece of code generates a dynamic listing of the values of a 'Action Tags' attribute, formatted as a fieldset group, to be used as part of an Advanced Search Form:
<fieldset> <legend> Action Tags </legend> {attributelist:actiontags} <div style=" float:left; clear:both"> <label><input type="checkbox" name="avc[]" value="[cvalue]" />[value]</label> </div> {/attributelist} </fieldset>
-
{contentlist@cid@Letter}...[link]....[name]...[faceimage]...{/contentlist}
-- This is a similar subtemplate construction that will print all included content sets in the site, broken down by category id (@cid) and by first letter (@Letter). For example, it could be used to create a page listing all available models, alphabetically, grouped by first letter.
Generic syntax:
-
{contentlist@cid}subtemplate{/contentlist}
or -
{contentlist@cid@L}subtemplate{/contentlist}
- cid is required, the category ID of content sets to be displayed. Master categories are not supported.
- @L is optional, L is the starting letter. If used, the tag would return only content sets starting with the given letter.
- @# would return content sets starting with any number
- If @L is omitted, the tag would print all active content sets, sorted in alphabetical order, regardless of their starting letter
- subtemplate is optional too, it is the code which will be used when printing every content set. It may contain three tags:
- *
[link]
- the URI of the content set gallery page - *
[name]
- the name/title of the content set - *
[faceimage]
- the URL of the face image
- *
- If subtemplate is omitted, it would be assumed to be
<a href="[link]">[name]</a>
Gallery Template Fragments
This is an optional feature which allows certain links to gallery pages to display only parts of the gallery pages (fragments), while the remaining parts are hidden. The most common use is when the content sets contain both pictures and videos (in one folder) but you want to differentiate between pictures and videos both visually and functionally (have different links to pictures and videos, as if they were separate content sets).
Here's the generic syntax and usage.
1. In any section template where you have a [ahref*]
(or [relref*]
or [groupref*]
) tag, you may add a gallery template fragment identifier, which consist of the ^
caret character followed by any alphanumeric string.
For example, instead of <a href="[ahref_new1@5]">
you may have
<a href="[ahref_new1@5]^pictures">
The fragment identifiers are case-insensitive and only the 26 alphabetical letters and the 10 digits make sense, which means that the following identifiers will all denote the same fragment of a gallery template:
-
^pictures
-
^Pictures
-
^_PICTURES_---------------------------------
2. In any gallery template you may enclose any part of the template HTML code in these tags:
[^fragment]....[/^fragment]
For example:
header html and other common stuff goes here [^pictures----------------------------------------------------] html code including content tags which make up the pictures part of the template [/^pictures----------------------------------------------------] [^videos----------------------------------------------------] html code including content tags which make up the videos part of the template [/^videos----------------------------------------------------] page navigation, footer and other common stuff
The same rules for the string-fragment indentifier apply here.
The dashes are not required at all, they are given only to provide a better visual distinction of the different parts of the templates. The fragment id in the section template would still be just ^pictures
.
You may have as many dashes, or different non-alphanumeric characters here for this visual separator, but it is important to know that the closing tag [/^fragment]
must be exactly the same as the opening one, i.e. having the same kind and number of extra characters, otherwise MAS will return error during rebuilding and the template fragments will not work at all.
(tip: to be sure of the above, copy&paste the opening tag, then just add a slash after the left bracket.)
You may have multiple occurances of the same fragment in a gallery template if needed, just make sure all of them are closed properly.
Example:
[^pictures].....[/^pictures] [^videos].....[/^videos] --something else-- [^pictures].....[/^pictures] --something else--
3. If a content set using a gallery template with fragments is opened normally, without ^fragment identifier in the section tag, all fragments will be displayed (pictures, videos, everything).
If a fragment identifier is given, only that fragment would be displayed, and of course the html parts outside of the [^fragment] tags.
TIP: If you want to provide a default fragment that will be displayed if the page is open without any fragment identifier (instead of displaying all fragments), you can put the following code at the top of the gallery template (substitute videos with the fragment id you want to be default):
<? if (empty($MAS_TemplateFragment)) $MAS_TemplateFragment = 'videos'; ?>
Or, use this more sophisticated code instead, in cases where you're using the Image Container template to show hi-res photos and the [levelup]
tag from the container page should bring the user back to the ^photos fragment, otherwise use the ^videos fragment as default:
<? if (empty($MAS_TemplateFragment)) { if (!empty($_SERVER['HTTP'.'_REFERER']) && basename(parse_url($_SERVER['HTTP'.'_REFERER'],PHP_URL_PATH))=='view.php') $MAS_TemplateFragment = 'photos'; else $MAS_TemplateFragment = 'videos'; } ?>
4. Additional navigation tags, inside the gallery template.
-
[this]
- link back to the current page, with the currently displayed fragment, if any (e.g.:<a href="[this]">Permanent link to this page</a>
)
-
[this^]
- link to the current content set gallery page, but without any fragment selected
-
[this^fragment]
- link to the current content set page, but with a specific fragment. For example, when you want to link to the video fragment from the pictures fragment, and vice versa.