PDA

View Full Version : expand contract / Switch Content Script / HELP



eduvauchelle
06-24-2005, 05:49 AM
HI,
I am using Movabletype for my website, and they have an option to display and extended version of the entry but by default, this links you to a new page. i am trying to use the Switch Content Script for my site so that people can expand as they wish the entries to my portfolio. I can't seem to make this work, keep in mind most extended entries i have will have images in them that link to a pop up window with a full size image. maybe that causes issues?

any suggestions?

check the site http://www.contrecoups.com

please help me, i am desperate.

thanks
Reply With Quote

jscheuer1
06-24-2005, 08:57 AM
Um, sorry not to reply with a quote. The main problem with your page that you gave the link for is that it had 3 divisions on it each with the id 'sc1'. There are situations where this can by OK but, it is never, as they say, valid. One unique id per page, applied to one unique element. Anyways, after I removed the other two id="sc1" attributes from their respective divisions, the switch content script worked fine on this division/spans pair:
<span onClick="expandcontent(this, 'sc1')" style="cursor:hand; cursor:pointer"><span class="showstate"></span></span><br><br>

<div id="sc1" class="switchcontent">
<p>
This Piece here is a ONE OFF (YES we . . .

eduvauchelle
06-24-2005, 01:43 PM
The problem is that the content is generated automatically, i don't write the html for each post.

<MTEntryIfExtended>
<span onClick="expandcontent(this, 'sc1')" style="cursor:hand; cursor:pointer"><span class="showstate"></span></span><br><br>
</MTEntryIfExtended>
<div id="sc1" class="switchcontent">
<$MTEntryMore convert_breaks="0"$>
</div>

So everytime there will be a new post with extended content, it will have the same SC1 id, unless there is a way to change that? i don't mind using another method, this is the only one i found...does this make sense?

jscheuer1
06-24-2005, 07:05 PM
For that you need to refer to your movabletype documentation or post in a movabletype forum. One clue I can offer is that if there is anything unique about each post that you can access and assign, use that as your id. If it begins with a number, preface it with a letter. If it contains characters other than letters and numbers, strip those from it.

eduvauchelle
06-24-2005, 07:37 PM
MTEntryID
The numeric ID of this entry. This is useful for creating anchors for permalinks, and when linking to permalinks. By default the entry ID is not padded; in other words, for an entry with ID 8, this tag will produce only the value 8. Sometimes you would rather have your IDs padded; in that case, you can use the pad attribute to the MTEntryID tag:

<$MTEntryID pad="1"$>

This will zero-pad the entry ID to six (6) digits, like 000008.

-----

thanks
<MTEntryIfExtended>
<span onClick="expandcontent(this, '<$MTEntryID pad="1"$>')" style="cursor:hand; cursor:pointer"><span class="showstate"></span></span><br><br>
</MTEntryIfExtended>
<div id="<$MTEntryID pad="1"$>" class="switchcontent">
<$MTEntryMore convert_breaks="0"$>
</div>
-----

worked!

you rock, can you tell i am happy!