View Full Version : Expanded display of multi-page entries
On showentry.php, if an entry has multiple pages would it be possible to have each page title linked to the that page of the article? Anywhere on the page would be nice, but I was thinking inside of the content either to the left or right.
Something along the lines of this:
3576
Lionel
08-12-2007, 11:26 PM
I agree. I was thinking of creating my own TOC and place it somewhere, probably at the top. I am going to wait a little. It's so easy to do and so necessary, maybe Brian will incorporate it
Care to share how to go about getting the URLs of each page? I've got it working fine as far as showing all of the page titles with just templates modifications. I'm stuck at the links.
Lionel
08-13-2007, 01:57 AM
I don't know if there are any better ways, but me I would use the data from that table: new_adv_dyna_entries_pages . I have not looked yet, but should be fairly easy to extract, in fact they might have already been extracted. In those data you have pagenumber in same row with titles. Use them for the links.
Well, I can't figure out how to pull the URL of the main entry page. I can pull the page numbers but I can't seem to get the first part of the URL. I'm sure I could figure out how to use $scriptpath and truncate it if needed, but I know there has to be a better way than that.
I'm not any type of a coder by any means, but I'm looking at it and I don't see a way of extracting the first entry page URL from any of the others (unless it's page2 then $prevpagelink would work). :\
Lionel
08-13-2007, 02:16 AM
The first part is the same as the nextpage link. Just use that and add pagenumber to it, just like they do it
LOL... thanks, not sure how I skipped over that. $entry[url] seems simple enough. ;x
Yay, now every works :D
Thanks again!
Lionel
08-13-2007, 02:26 AM
will you save me some time and share your template?
Sure, but it's messy Lol... maybe somebody can clean it up a bit ;x
I added this before "$entry[pagetext_parsed]" in ADV_DYNA_SHOWENTRY
<if condition="$multipage[2]">
<div style="float:right; padding:10px">
<table border="0" cellpadding="6" cellspacing="1" class="tborder" width="200">
<thead>
<tr>
<td class="tcat" colspan="0">
<a href="#top" rel="nofollow" onclick="return toggle_collapse('module_adv_entrynav')" style="float:right"><img alt="" border="0" id="collapseimg_module_adv_entrynav" src="$stylevar[imgdir_button]/collapse_tcat.gif" /></a>
<span class="smallfont"><strong>» Entry Navigation</strong></span></td>
</tr>
</thead>
<tbody id="collapseobj_module_adv_entrynav" style="">
<tr>
<td class="alt2">
<ol style="list-style-type: decimal">
<li><a href="$entry[url]">$entry[title]</a></li>
<li><a href="$entry[url]page2.html">$multipage[2]</a></li>
<if condition="$multipage['3']"><li><a href="$entry[url]page3.html">$multipage[3]</a></li></if>
<if condition="$multipage['4']"><li><a href="$entry[url]page4.html">$multipage[4]</a></li></if>
<if condition="$multipage['5']"><li><a href="$entry[url]page5.html">$multipage[5]</a></li></if>
<if condition="$multipage['6']"><li><a href="$entry[url]page6.html">$multipage[6]</a></li></if>
<if condition="$multipage['7']"><li><a href="$entry[url]page7.html">$multipage[7]</a></li></if>
<if condition="$multipage['8']"><li><a href="$entry[url]page8.html">$multipage[8]</a></li></if>
<if condition="$multipage['9']"><li><a href="$entry[url]page9.html">$multipage[9]</a></li></if>
<if condition="$multipage['10']"><li><a href="$entry[url]page10.html">$multipage[10]</a></li></if>
</ol>
</td>
</tr>
</tbody>
</table>
</div>
</if>
Lionel
08-13-2007, 02:40 AM
Oh you did it with conditionals. I was thinking of doing it with one $pagelink where $pagelink is a template with the link title and would be after <ol>. This way, if you were to have 11 pages or more, you don't miss it.
I'm not sure what $pagelink is, I would have to try that... right now I have mine set to a maximum of 10 pages, that's why I only went to 10. I was just trying to get it to work without having to change any of the actual code.
If you're able to condense it and make it work with any amounts of pages and without all the extras ($multipage['X']), I'd be interested in using it! :)
Edit: Nevermind, I understand what you mean... that would be much better. Lol
Lionel
08-13-2007, 02:49 AM
$pagelink is a $variable that represents a template i would make to display links.
If Brian does not add it in its list, then i'll do it and post my copy.
Yeah, I got that after I posted... I shouldn't be reading, responding and on the phone all at the same time. :p
Thanks for your help again :)
Brian
08-13-2007, 09:55 AM
Good idea guys. I'll see if I can work something like this in soon.
Shon - Any chance you could link me to a page where you've added this? I'm curious to see how you've implemented it. :)
PM sent with link...
Right now, with what I have, the width could be a problem with longer titles and by default the first page (entry page) doesn't have a multiple page title ($multipage[1]) so I used $entry[title] for the time being. The entry title probably isn't the best thing to use for the title of the first page (if there are multiple pages) because usually all of the pages will be about the same subject, just using sub-titles.
I haven't really played with it long enough to make any type of suggestions for it... but something along those lines. :D
Lionel
08-13-2007, 06:05 PM
PM sent with link...
by default the first page (entry page) doesn't have a multiple page title ($multipage[1]) so I used $entry[title] for the time being. The entry title probably isn't the best thing to use for the title of the first page (if there are multiple pages) because usually all of the pages will be about the same subject, just using sub-titles.
In Gars, you have the option to title first entry, if not it uses the generic "Page 1" or "Introduction" which makes more sense because of the reason you pointed.
Well, it does have the option of giving the first page a title when posting multiple pages, but it doesn't require it. In fact none of the pages are required to have a title. I'm not sure if it's an option in the admincp to require that, but if not, I think it should be (I'll check). :p
Lionel
08-13-2007, 06:20 PM
Now that we have the big guy sold on the idea, all we need to do is wait and it will be perfect. This time, I want to try to avoid hacking as much as possible so I don't have to do them over in upgrading.
The only thing I see about titles anywhere is for replies (posts) to entries and that is whether or not to allow titles in posts. There's nothing about titles under Add\Edit Entries Options. There is that Add Setting link at the top though... so technically I guess it would be up to whether he thinks it will be useful for most people.
Lionel
08-13-2007, 06:33 PM
In order to keep it simple and expeditive, I would use "Introduction" for first page
I agree, it would also be great to be able to set default titles like Introductions, Conclusions, Closing, or whatever to the first\last pages as well as requiring them or allowing them to be changed and to require titles period (mostly because the whole idea of me starting this thread revolves around page titles :p).
I think this is starting to get a bit more complex than it originally started... it was just a little module type block, now we're talking about more options and all types of things. I'm now wishing I was around for a few of the discussions for suggestions and such. Last I heard it will still Blogicles, and was mostly going to be for blogs, but I'm seeing a LOT of possibilities with it and although it's already extremely versatile, it has much room for many improvements. On the other hand, if it had everything on the first release, there wouldn't be any more releases. Lol
Brian
08-14-2007, 12:25 PM
Thanks for the link Shon. Just wanted to get some ideas of how it could be implemented with future releases.
And as you said, there's always room for improvement, and I'm sure there will be many made down the line. We felt that the product was at a point where it had enough features and options to be useful though, so it was time for the release and then to decide what other features were needed in future releases based on the feedback. ;)
Sounds like a perfect strategy to me. Hopefully I can be of more use now than in the past before I got all updated! :)
vBulletin® v3.7.2, Copyright ©2000-2008, Jelsoft Enterprises Ltd.