No teaser text is appearing.

Permalink Browser Info Environment
Installed the block, and selected the "Teasers" custom template, I have truncate descriptions checked, but no teaser text is appearing. The page in question contains only text content.

Type: Discussion
Status: New
RebeccaSt
View Replies:
jordanlev replied on at Permalink Reply
jordanlev
Could be a few different things...

Does it work if you don't check "Truncate descriptions"?

Is the text content in an area called "Main"? By default it always looks in that area (you can change this though -- add the following line to your "site.php" file in your site's "config" folder:
define('PAGE_LIST_TEASERS_AREA', 'Teaser'); //Can be any area name


Are there other blocks before the text content? What kind of blocks are they (e.g. "Content", "HTML", etc.)?
RebeccaSt replied on at Permalink Reply
RebeccaSt
Ok, it was not in an area called "Main". Once I used "Main" it works.

How can I have more than one of these on a page if it only works with "Main"?

I put:

define('PAGE_LIST_TEASERS_AREA', 'Teaser');


in the config/site.php and created a "Teaser" area but it didn't work?

Thanks!!
jordanlev replied on at Permalink Reply
jordanlev
You need to do either one or the other -- either put the content in the "Main" area, OR add the line of code to config/site.php. If you don't want to have to put your content in the "Main" area, then you need to put in the line of code and change "Teaser" to the name of the area that you DO want the content in.

This addon is only designed to pull teasers from one area on a page -- if for some reason you have two different Page Lists and you want each one to show different excerpts of content, then unfortunately this won't work for you.

-Jordan
RebeccaSt replied on at Permalink Reply
RebeccaSt
Ah, got it. I can deal with that. It's all working now, at least. Thanks!
tlloyduk replied on at Permalink Reply
tlloyduk
In the latest build, adding the define() in site.php as above does not work because "Main" is hard coded in this file:

packages/page_list_teasers/blocks/page_list/templates/teasers.php


on line 17. Changing it there fixes the problem.
jordanlev replied on at Permalink Reply
jordanlev
You are correct that the latest version of the addon does not have the PAGE_LIST_TEASERS_AREA definition anymore, and the new way is more consistent with how Concrete5 custom templates work (and easier to change in my opinion).

Here are specific instructions...

Edit the packages/page_list_teasers/blocks/page_list/templates/teasers.php, find this line of code:
$teaser = $plth->getPageTeaser($page, 'Main', $teaserBlockCount, $teaserTruncateChars);

...and change it to this:
$teaser = $plth->getPageTeaser($page, 'Some Other Area', $teaserBlockCount, $teaserTruncateChars);


Then clear your site cache via the dashboard.

-Jordan

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.