5.3.4.1. Templates
5.3.4.1.1. Main Post Template
This template defines the content of the post. Anything you want to show in the post content
should be added into this template. If this template is not defined, it is assumed that the
template is [wcc-main-content]
so that the values found by Post Content Selectors are added
as post content. The short codes available for this template and their explanations are given in
Table 5.2.
Short code | Explanation |
---|---|
[wcc-main-title] |
Title of the post after the template defined in Post Title Template are applied. This is the final title of the post. |
[wcc-main-excerpt] |
Excerpt of the post after the rules defined in Find and replace in post’s excerpt and the template defined in Post Excerpt Template are applied. So, this is the final excerpt of the post. |
[wcc-main-content] |
The main post content found by the selectors defined in Post Content Selectors |
[wcc-main-list] |
The list that is found by the settings of List Type Posts Section and whose template is defined in List Item Template |
[wcc-main-gallery] |
The gallery whose items are saved by using the selectors defined in Gallery Image URL Selectors setting and whose template is defined in Gallery Item Template |
[wcc-source-url] |
Full URL of the target page. You can use this to reference the source
page. E.g. <a href="[wcc-source-url]">Source</a> |
Custom short codes | The custom short codes defined by you using the settings under Custom Short Codes Section |
5.3.4.1.2. Post Title Template
You can define a template for the post’s title using this setting. If nothing is defined, it will
be assumed that the template is [wcc-main-title]
. The short codes available for this template and
their explanations are given in Table 5.3.
Short code | Explanation |
---|---|
[wcc-main-title] |
Title of the post that is found by the selectors defined in Post Title Selectors setting. Also, rules defined in Find and replace in post’s title setting are applied. |
Custom short codes | The custom short codes defined by you using the settings under Custom Short Codes Section |
5.3.4.1.3. Post Excerpt Template
You can define a template for the post’s excerpt using this setting. If nothing is defined, it will
be assumed that the template is [wcc-main-excerpt]
. The short codes available for this template and
their explanations are given in Table 5.4.
Short code | Explanation |
---|---|
[wcc-main-excerpt] |
Excerpt of the post that is found by the selectors defined in Post Excerpt Selectors setting. Also, rules defined in Find and replace in post’s excerpt setting are applied. |
[wcc-main-title] |
Title of the post after the template defined in Post Title Template are applied. This is the final title of the post. |
Custom short codes | The custom short codes defined by you using the settings under Custom Short Codes Section |
5.3.4.1.4. List Item Template
If you configured the settings under List Type Posts Section, then you have to configure this template so that the list can be created. See List Type Posts Section for more information. The short codes available for this template and their explanations are given in Table 5.5.
Short code | Explanation |
---|---|
[wcc-list-item-position] |
Position of the list item found by the selectors defined in List Item Number Selectors or the number that is automatically assigned for the list item when you enable Insert list item numbers automatically? setting |
[wcc-list-item-title] |
Title of the list item found by the selectors defined in List Item Title Selectors |
[wcc-list-item-content] |
Content of the list item found by the selectors defined in List Item Content Selectors |
Custom short codes | The custom short codes defined by you using the settings under Custom Short Codes Section |
5.3.4.1.5. Gallery Item Template
Define a template for each gallery item found by the selectors defined in
Gallery Image URL Selectors setting. This is mandatory if you want to show the gallery
inside the post. Also, you have to include [wcc-main-gallery]
short code into
Main Post Template. The short codes available for this template and their explanations are
given in Table 5.6.
Short code | Explanation |
---|---|
[wcc-gallery-item-url] |
URL of a gallery item found by the selectors defined in Gallery Image URL Selectors setting. |
Custom short codes | The custom short codes defined by you using the settings under Custom Short Codes Section |
For example, if the gallery item is an image, you can define a template as shown below:
<img src="[wcc-gallery-item-url]">
Let’s assume there are 3
images found by the selectors defined in
Gallery Image URL Selectors setting as http://site.com/image1.jpg
,
http://site.com/image2.jpg
, and http://site.com/image3.jpg
. With the template shown above,
[wcc-main-gallery]
short code will be replaced with the code below:
<img src="http://site.com/image1.jpg">
<img src="http://site.com/image2.jpg">
<img src="http://site.com/image3.jpg">
If the template is defined as shown below:
<li><img src="[wcc-gallery-item-url]"></li>
[wcc-main-gallery]
short code will be replaced with the code below:
<li><img src="http://site.com/image1.jpg"></li>
<li><img src="http://site.com/image2.jpg"></li>
<li><img src="http://site.com/image3.jpg"></li>
To include this as a list in Main Post Template, you can define a template in Main Post Template as shown below:
[wcc-main-content]
<ul>[wcc-main-gallery]</ul>