Static Page with Related pages: cant get more than 5 entries

Creating and modifying plugins.
Post Reply
natcase
Regular
Posts: 6
Joined: Fri Oct 04, 2013 5:34 pm
Location: Minneapolis, Minnesota, USA
Contact:

Static Page with Related pages: cant get more than 5 entries

Post by natcase » Fri Oct 04, 2013 5:46 pm

I am using the Static Pages plugin, and want to allow many entries within that. In the template "plugin_staticpage_related_category.tpl", is what appears to be the place to set the number of entries:

{serendipity_fetchPrintEntries category=$staticpage_related_category_id template="staticpage-entries-listing.tpl" limit=7 noSticky="true"}

However, varying that limit variable makes no change in the number of entries shown: it is always 5. Where is the variable that controls this number? There is nothing in staticpage-entries-listing.tpl or in any of the other related docuemnts in the plugin folder, that I can see. What am I missing?

User avatar
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Static Page with Related pages: cant get more than 5 ent

Post by Timbalu » Fri Oct 04, 2013 6:38 pm

Could you try using limit="0,7" ? Or maybe its just the missing quotes for the single num.
In the docs http://www.s9y.org/78.html it says:
limit
(string)
Holds a "Y" or "X, Y" string that tells which entries to fetch.
X is the first entry offset, Y is number of entries. If not set,
the global fetchLimit will be applied (15 entries by default)
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian

natcase
Regular
Posts: 6
Joined: Fri Oct 04, 2013 5:34 pm
Location: Minneapolis, Minnesota, USA
Contact:

Re: Static Page with Related pages: cant get more than 5 ent

Post by natcase » Fri Oct 04, 2013 6:52 pm

Thanks, Timabalu. That certainly looks like it should work, but it doesn't. I tried it with quotes and without, and with comma delimiters and without. Nothing/ And it's not reverting to the global 15 entry limit quoted, but to 5, every time, so there must be an overriding setting somewhere in another file.

User avatar
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Static Page with Related pages: cant get more than 5 ent

Post by Timbalu » Fri Oct 04, 2013 7:18 pm

The general entry limit is in Serendipity Backend: Configuration → Design and Options. What does it say, 15 or 5?

Edit:
Are you working inside "plugin_staticpage_related_category.tpl"? And where located?
Did you enable entry type: staticpage with releated category, inside the (Structural) entries staticpage settings?

The limit 5 is the default set limit in plugins/serendipity_event_staticpage/plugin_staticpage_related_category.tpl:

Code: Select all

{serendipity_fetchPrintEntries category=$staticpage_related_category_id template="../../plugins/serendipity_event_staticpage/staticpage-entries-listing.tpl" limit=5 noSticky="true"}
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian

natcase
Regular
Posts: 6
Joined: Fri Oct 04, 2013 5:34 pm
Location: Minneapolis, Minnesota, USA
Contact:

Re: Static Page with Related pages: cant get more than 5 ent

Post by natcase » Fri Oct 04, 2013 9:15 pm

Thanks for all your notes.
Timbalu wrote:The general entry limit is in Serendipity Backend: Configuration - Design and Options. What does it say, 15 or 5?
Now that would be the key. For the next hour or two I'm locked out of the backend while my tech help unlocks the password—we're not sure what's up with that, but it changed without anyone being aware that it changed. Worrying. IN any case, once I can get in, I'll check that. It seems to be the easiest option...
Timbalu wrote:Edit:
Are you working inside "plugin_staticpage_related_category.tpl"? And where located?
Did you enable entry type: staticpage with releated category, inside the (Structural) entries staticpage settings?
The limit 5 is the default set limit in plugins/serndipity_event_staticpage/plugin_staticpage_related_category.tpl:

Code: Select all

{serendipity_fetchPrintEntries category=$staticpage_related_category_id template="../../plugins/serendipity_event_staticpage/staticpage-entries-listing.tpl" limit=5 noSticky="true"}
The file "plugin_staticpage_related_category.tpl" is within /plugins/serendipity_event_staticpage, and yes I am editing it directly. I'm editing it in a text editor and then replacing it into the running folder.

And the line you quote is the alternate version; the live version that from the original version has template="staticpage-entries-listing.tpl" instead of template="../../plugins/serendipity_event_staticpage/staticpage-entries-listing.tpl" but it doesn't matter which line I put in; it still stays the same.

If I can fix this with the backend, I'll be fine, but it's a little worrying that the template won't override the master settings. Then again, it's not the only place this is true: I can't for love or money make the sidebar wider in my template. But that's another conversation... Thanks again.

natcase
Regular
Posts: 6
Joined: Fri Oct 04, 2013 5:34 pm
Location: Minneapolis, Minnesota, USA
Contact:

Re: Static Page with Related pages: cant get more than 5 ent

Post by natcase » Fri Oct 04, 2013 11:41 pm

natcase wrote:
Timbalu wrote:The general entry limit is in Serendipity Backend: Configuration - Design and Options. What does it say, 15 or 5?
Now that would be the key. For the next hour or two I'm locked out of the backend while my tech help unlocks the password—we're not sure what's up with that, but it changed without anyone being aware that it changed. Worrying. IN any case, once I can get in, I'll check that. It seems to be the easiest option...
And I got back in, and they are all set to 15. So much for that idea. Next!

User avatar
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Static Page with Related pages: cant get more than 5 ent

Post by Timbalu » Sat Oct 05, 2013 10:51 am

natcase wrote:And the line you quote is the alternate version; the live version that from the original version has template="staticpage-entries-listing.tpl" instead of template="../../plugins/serendipity_event_staticpage/staticpage-entries-listing.tpl" but it doesn't matter which line I put in; it still stays the same.
No. That's not true. It is the default standard line and the other is the one to uncomment, in case of really using a changed staticpage-entries-listing.tpl, placed in your template directory (if really needed).

Code: Select all

<div class="staticpage_related_category_entry_list">
{* standard - if you use it on a shared-s9y-installation you have to correct the path to staticpage-entries-listing.tpl *}
{serendipity_fetchPrintEntries category=$staticpage_related_category_id template="../../plugins/serendipity_event_staticpage/staticpage-entries-listing.tpl" limit="7" noSticky="true"}

{*  if you use your own static-entries.tpl in your template, take this:  *}
{*  {serendipity_fetchPrintEntries category=$staticpage_related_category_id template="staticpage-entries-listing.tpl" limit=5 noSticky="true"}  *}
</div>
A {* xxx *} means commented out, in Smarty terms. The first (standard) one points to the plugin dir when called by your frontend (which is internally /ser/templates/mt_gettysburg/). That is why the exact path is needed to bet set like this, to find the correct place of the default staticpage-entries-listing.tpl file.
natcase wrote:If I can fix this with the backend, I'll be fine, but it's a little worrying that the template won't override the master settings. Then again, it's not the only place this is true: I can't for love or money make the sidebar wider in my template. But that's another conversation... Thanks again.
Yes that is strange. Normally - for templates without any own .tpl files - the Serendipity fallback mode is to the default/ template via the bulletproof/ template for css etc. Now, default/index.tpl looks like:

Code: Select all

<table id="mainpane">
    <tr>
{if $leftSidebarElements > 0}
        <td id="serendipityLeftSideBar" valign="top">{serendipity_printSidebar side="left"}</td>
{/if}
        <td id="content" valign="top">{$CONTENT}</td>
{if $rightSidebarElements > 0}
        <td id="serendipityRightSideBar" valign="top">{serendipity_printSidebar side="right"}</td>
{/if}
    </tr>
</table>
Yours looks like:

Code: Select all

<table id="mainpane">
    <tr>
        <td id="serendipityLeftSideBar" valign="top" width="250">    .....
The template seems to be mt_gettysburg and should normally look like this: https://github.com/s9y/Serendipity/blob ... llsize.jpg
I can't see where you get that width="250" from in <td id="serendipityLeftSideBar" width="250" valign="top">. That might be while you have your own index.tpl in your template directory.

In short: Find this and either rewrite it to something bigger or purge it (recommended!) and do it via css by eg.

Code: Select all

#serendipityLeftSideBar { width: 20%; /*or 300px */ }
The normal style in /default/style.css is:

Code: Select all

#serendipityLeftSideBar, #serendipityRightSideBar {
    background: none repeat scroll 0 0 #999999;
    color: #333333;
    font-family: verdana,arial,sans-serif;
    vertical-align: top;
    width: 200px;
}
, which seems to overwrite your hardcoded width="250". If you copy that block, change the width to 20% and include that to your mt_gettysburg/style.css file. And all will be well.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian

User avatar
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Static Page with Related pages: cant get more than 5 ent

Post by Timbalu » Sat Oct 05, 2013 11:27 am

Ok. Now I found the real issue for the first!
The standard template bulletproof includes a "plugin_staticpage_related_category.tpl" file. Since the Serendipity fallback mode searches in 1. yourTemplate → 2. bulletproof → 3. default → 4. thePlugin Directory, it always takes the second if it finds the one in there.
https://github.com/s9y/Serendipity/blob ... ry.tpl#L57

Now, since this is like this, you have to copy the bulletproof "plugin_staticpage_related_category.tpl" file to your gettysburg template, adjust the limit, and all will work fine. I personally do not know why bulletproof had to set and hold a staticpage template file for this, but we will definitely have to note that inside staticpages. :) Maybe Don or Yellowled can give us a hint why this was needed.

Edit:
I updated the staticpage plugin to note this in "plugin_staticpage_related_category.tpl" and added some changes, which are in the bulletproof copy. Available via Spartacus tomorrow.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian

natcase
Regular
Posts: 6
Joined: Fri Oct 04, 2013 5:34 pm
Location: Minneapolis, Minnesota, USA
Contact:

Re: Static Page with Related pages: cant get more than 5 ent

Post by natcase » Sun Oct 06, 2013 3:48 pm

Timbalu wrote:Ok. Now I found the real issue for the first!
The standard template bulletproof includes a "plugin_staticpage_related_category.tpl" file. Since the Serendipity fallback mode searches in 1. yourTemplate → 2. bulletproof → 3. default → 4. thePlugin Directory, it always takes the second if it finds the one in there.
https://github.com/s9y/Serendipity/blob ... ry.tpl#L57

Now, since this is like this, you have to copy the bulletproof "plugin_staticpage_related_category.tpl" file to your gettysburg template, adjust the limit, and all will work fine. I personally do not know why bulletproof had to set and hold a staticpage template file for this, but we will definitely have to note that inside staticpages. :) Maybe Don or Yellowled can give us a hint why this was needed.

Edit:
I updated the staticpage plugin to note this in "plugin_staticpage_related_category.tpl" and added some changes, which are in the bulletproof copy. Available via Spartacus tomorrow.
Brilliant! Problem solved! Note that you need to move staticpages-entries-listing.tpl too. Thank you so much! And that insight about bulletproof is crucial... I was editing the "default" templates, before, because, well, I figured they were the default...

User avatar
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: Static Page with Related pages: cant get more than 5 ent

Post by Timbalu » Sun Oct 06, 2013 5:28 pm

Well, yes only if you change the default "../../plugins/serendipity_event_staticpage/" path. If not it points to the plugin directory.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian

Post Reply