Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Andrew Denham 8 posts 28 karma points
    Nov 18, 2011 @ 19:55
    Andrew Denham
    0

    2 column layout based on number of paragraph tags

    Hi,

    What I would like to do is enter content in a Rich Text Editor and have it displayed in 2 columns.

    I would like to create a macro that counts the no. of paragraphs and divides by 2. Then if there are 8 paragraphs it display the first 4 in the left column and the next 4 in the right column. Or  if 7 paragraphs the first 4 left then 3 in the right?

    Is this actually possible or would I have to create 2 Text Editors, one for each column? Or split into two columns after set number of characters or words?

    Any ideas, better suggestions or solutions would be very appreciated.

    Thank you

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Nov 18, 2011 @ 22:17
    Jan Skovgaard
    0

    Hi Andrew

    As I see it the best way forward is to either create two rich text editors - one for each column or perhaps look into enabling the template plugin for tinymce as described in this wiki entry: http://our.umbraco.org/wiki/how-tos/enabling-the-%27template%27-plugin-for-tinymce


    Hope this helps.

    /Jan

  • Jon Boyer 37 posts 59 karma points
    Nov 20, 2011 @ 23:31
    Jon Boyer
    0

    If you're happy with the graceful degradation involved, you could simply use the css3 column-count attribute (http://www.quirksmode.org/css/multicolumn.html etc).

     

    Alternatelty, you could use some jquery to count up the paragraphs and apply different classes to the paragraphs in the first half and the second half.

     

     

     

     

Please Sign in or register to post replies

Write your reply to:

Draft