Help - Search - Members - Calendar
Full Version: how do i make the extended entry open in a pop-up?
Movable Type Community Forum > Additional Resources > Tips and Tricks
moosekow
i've tried searching the forum for an answer, but i couldn't find any.

i was wondering if it's possible to have a link for extended entry (eg. "more...") and when the user clicks on the link, the extended entry is displayed in a pop-up window (fixed size). The pop-up window should only show the contents of the extended entry.

has anyone tried this successfully before?  tongue.gif
kadyellebee
You could use a second individual entry template for this.

Just put all the design that you want it in with only the basic tags in it -
CODE
<MTEntries><$MTEntryExcerpt$></MTEntries>

This will be generated for each entry you make.

Then use an archive filename (in Blog Config under Archiving) to name them differently than your normal Individual Archives - something like this:
CODE
<$MTEntryID pad="1"$>_extend.html

and then in your Main Index Template, you'll want to add some code so this will popup -
CODE
    <MTEntryIfExtended>
    <span class="extended"><a href="<$MTBlogArchiveURL$><$MTEntryID pad="1"$>_extend.html" onclick="OpenComments(this.href); return false">MORE</a></span></MTEntryIfExtended>

This will open it up in the same sized window as popup comments would.

Hope this helps!
Kristine
moosekow
thanks for trying to help!

i did what you suggested, except for the first part i put:

CODE
<MTEntries><$MTEntryMore$></MTEntries>


i would have thought it'd work..but i still faced a problem: instead of showing the extended text for that particular entry, the pop-up showed the extended text for ALL my entries one after another in the window!  :0

The pop-up doesn't seem to be able to recognise the entry ID and pick out the relevant extended text.

Any solutions for this?   huh.gif
kadyellebee
Did you use a new Index Template or a new Archive Template?  It should be an Archive Template - this is done in the context of each entry, so it *shouldn't* show all the entries.  

And sorry, I knew you meant MTEntryMore, I musta gotten carried away when I was typing wink.gif

Kristine
moosekow
i created a new Archive Template and associated it with Individual Archive like you advised, with template name:
CODE
<$MTEntryID pad="1"$>_extend.html


Could it be because the "_extend.html" file itself doesn't have an entryID so it doesn't know which extended text to display? it seems to be working like an external file that displays ALL extended text. I checked all my "_extended.html" files created, and they all displayed the same thing (ie. extended text for ALL entries)
kadyellebee
Oh man, I'm silly.  I just went back and looked at the default template for the Individual Archive, and I figured out my mistake.  Individual archives don't need MTEntries containers in them.  So JUST put
CODE
<$MTEntryMore$>
in it, and try that smile.gif

Sorry!  
Kristine
moosekow
YESSS!!

It worked! You are amazing!  :D

Thanks so much for your help. I can't believe I couldn't figure this out... ahaha. I guess sometimes the simplest solutions are the hardest to find.

WOOHOO.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.