Results 1 to 5 of 5

Thread: expand contract / Switch Content Script / HELP

  1. #1
    Join Date
    Jun 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default expand contract / Switch Content Script / HELP

    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

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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:
    HTML Code:
    <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 . . .
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jun 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default yeah but how do i automatically make new SC1, SC2 etc...

    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; cursorointer"><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?

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Jun 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default It Worked!

    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; cursorointer"><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!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •