tinymce4 and Description image path

I really did look for this in a previous post. Since the update to tinymce4 I have the following problem: any path to an image contained within a Description field gets changed to to: /zp-core/... . I can't see where to change this behavior. My workaround has been to turn off the plugin, but now I need to do a lot of descriptions and it would be really nice to have the text editor available. The images I'm pointing to are above the zp-core folder.

Comments

  • You will probably need to provide some more information.

    What description field are you inserting the image in?

    What technique do you use to insert it?

    What exactly is the link that you insert?

    I certainly did insert an image into an album description and it did work correctly. My guess is that you inserted a "relative" link. You need to specify the full path.
  • pupa Member
    yes, I insert a link like "images/folder/image.jpg" and when I "Apply" the path becomes /zp-core/images/folder/image.jpg". My work around for the moment is to copy all my images into the zp-core/images folder, but here are many hundreds and when it's time to update Zenphoto I don't want to lose them. I usually delete the zp-core folder on the server when I update. The purpose of this is a Fancy Zoom thing, eg:
    http://summerhill-antiques.com/index.php?album=inventory&image=1389.jpg
  • pupa Member
    ugh. Reinstalled 1.4.6 and now I am unable to Unpublish albums.
  • pupa Member
    I reinstalled 1.4.5.9 and went back to tinymce now everything works as expected. It's too bad, because 1.4.6 had some really nice improvements :(

    If you could look at the page I linked above and suggest a fix (I tried editing the tinymce4/config/*.php) I would prefer to use the latest Zenphoto
  • acrylian Administrator, Developer
    We really will need more info about 1.4.6 problems to be able to help. You should never copy anything to the zp-core folder or change files within. If you update you also need to delete the index.php file in the root.

    If you insert links you need to insert absolute paths simply because the backend is in a different location than the front end you are actually inserting the image for. I don't think that the url configuration in TinyMCE has changed. But maybe the update from v3 to v4 changed some default. If inserted urls should be relative or absolute can be configured:
    http://www.tinymce.com/wiki.php/Configuration:relative_urls
    All of our included config files are set to absolute urls already.

    I actually haven't understood exactly what image that are and where they are. If you are inserting images from the gallery / albums the best way is to use tinyZenpage (the "ZP" button on the tinymce toolbar).

    You can get such a zoom by enabling the colorbox plugin and adding a jQuery call `$('.yourclass').colorbox();` to the `` of your theme and then add that `.yourclass` to the links inserted.

    A suggestion: I looked at the site and I would actually do all this different from the technical point of view. If I see correctly you have one produce with different views. I would use albums for each product where the main image would be the album thumb and the others additional images. Then no manual linking or inserting is necessary at all. There are theme function for the prev/next album as there are for images (live example on our site: http://www.zenphoto.org/theme/)
  • pupa Member
    Thanks so much for the detailed and long response! (one reason I still use Zenphoto is the great support!). I could create an album for each item, but presently I have over well over 800 items, so I'm not sure that's a good solution. I have another similar site which is using v1.4.6, so I'm going to play with the tinymce4 config and see if I can track down the difference. The "relative_urls:" in tinymce4 is new. Also I'll try an absolute path. I'm not particularly attached to the solution I've come up with, so I will also check out the colorbox plugin! Thanks for your help and the good ideas!
  • pupa Member
    OK, changing the tinymce4 config "relative_urls" to true kinda fixed the issue, although now I have to add a leading "/" in the path to my images for them to show in the editor on the admin page. (Curiously, they seem to show either way on the website). Now there is a new problem: tinymce4 seems to have rewritten all my digital entities "½" for example to the HTML version "½" which would seem to be fine -- they show up as fractions in the editor -- but on the webpage they show up as "&frac12". Any ideas? I would hate to have to edit 500 or so descriptions!
  • acrylian Administrator, Developer
    Thanks!

    Regarding your 800 items. Of couse that would make a lot of albums but also a clean structure. You would have to create one layout template for the layout and then never do any manual work again (you know you can have different layouts for theme pages using the multiple_layouts plugin ?). maybe give it a try if it works for you on your other install. But of course whatever works best for your purpose and existing site structure.

    I just checked we had `relative_urls: false` at least since the 1.4.4.x config files (and probably longer then) for TinyMCE v3 already. The functionality of it did not change between v3 and v4 according to the tinymce docs.

    But if that setting bothers you you can easily create your own config files. Just place them in `/plugins/tinymce4/config/ (but change the paths within to the new location)

    Regarding the fractions that looks like double htmlencodig. Could also be stored wrong in the database. Have to try to reproduce that.
  • pupa Member
    If it's any help, it looks like my digital entities (ie alt-089; for a fractional one-half) were converted to HTML entities (ampersand-frac12;) only on the descriptions for the items contained on the single admin page I worked on, this is, about 10 items. The other 700+ descriptions were unchanged. This is a relief!

    I enabled the colorbox plugin, but can't find any documentation on how to use it on my custom theme. I can't even find any examples. I'm using the Cabel Sasser FancyZoom which is nice because the image will zoom only enough to fit the available window.
  • acrylian Administrator, Developer
    So the issue with the fractions is more or less solved? I could not reproduce it. Probably a mismatch that lead to some double entitiy encoding like old entries that were stored as entities somehow.

    Colorbox is widely documented on its own site:
    http://www.jacklmoore.com/colorbox/

    Our plugin does not provide any default configuration except built in in standard themes since there are quite some. These *box scripts work all quite similar besides that and of course it does not need to be colorbox.
  • pupa Member
    I wouldn't say the fractions problem is solved, I'm just relieved that I don't have to go back and fix hundreds of Descriptions that contained fractions. The problem is that I used decimal entities in the Description (say, alt-0189 for 1/2) and when I edit the Description using the tinymce4 plugin, the decimal entities are changed to the HTML version, ie "ampersand-frac12;". I'm fine with that, but now instead of "½" on the webpage, I see the HTML entity. Here is an example:
    http://www.anticoii.com/index.php?album=the-collection&image=0807.jpg
  • acrylian Administrator, Developer
    I just tried again and I indeed can reproduce it now. The entitiy itself is correct as tinymce generates that. But it is somehow double encoded so it displays as that. It does work correctly with my belove German umlauts and other special chars but not here. No idea why right now.
Sign In or Register to comment.