SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    May 2007
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    dynamically wrap img tags in a div?

    Hi everybody,

    firstly I hope this is the right forum, please feel free to move or let me know if its not.

    I am building a newsletter site for my uni, I am using Tiny MCE to allow users to add and edit articles.

    I have a problem though which dispite my best efforst I can't seem to resolve through the use of theTiny MCE forum.

    In my static template I had thumbnails wrapped in a div class, so they could be given a caption and then positioned together.

    Right now there doesn't seem to be a way to automatically wrap any img tags in a div class using MCE (please feel free to correct me!).

    So is there a with Java Script to do something like find all my img tags and maybe the paragraph below it and then wrap them in a div with a class?

    maybe even php?

    Many Thanks

    Sam Germein

  2. #2
    rajug.replace('Raju Gautam'); bronze trophy Raju Gautam's Avatar
    Join Date
    Oct 2006
    Location
    Kathmandu, Nepal
    Posts
    4,013
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If any regex expert says and does for you the exact way for finding whole thing and wrap those in a div with a class, but i am unable to say that. What i would do myself and suggest you to do is:
    Don't use any editors like Tiny MCE for storing image and caption.
    Better use another separate table and form and that will make you easier to manipulate the data display.
    Mistakes are proof that you are trying.....
    ------------------------------------------------------------------------
    PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5


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
  •