Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi ,
I have the origin pull working great, my only issue is that custom content created in the ckeditor in panels the url is not being changed.
I know I could change this manually, but it would be cool if this worked.
Here is the html I added to the ckeditor in panels:
<div id="links_menu">
<div id="linkz">
<p>
<a href="http://www.flaunt.com/current_issue"><img border="0" he src="http://www.flaunt.com/sites/default/files/menu_link_list/magazine_small.png"/></a></p>
<p>
<a href="http://www.flaunt.com/flaunt_tv"><img border="0" src="http://www.flaunt.com/sites/default/files/menu_link_list/video_small.png"/></a></p>
<p>
<a href="http://www.flaunt.com/contact"><img border="0" src="http://www.flaunt.com/sites/default/files/menu_link_list/contact_small.png" /></a></p>
<p>
<a href="http://www.flaunt.com/features"><img border="0" src="http://www.flaunt.com/sites/default/files/menu_link_list/features_small.png" /></a></p>
<p>
<a href="http://www.flaunt.com/fashion"><img border="0" src="http://www.flaunt.com/sites/default/files/menu_link_list/fashion_small.png"/></a></p>
<p>
<a href="http://www.flaunt.com/fob"><img border="0" src="http://www.flaunt.com/sites/default/files/menu_link_list/fob_small.png" /></a></p>
<p>
<a href="http://www.flaunt.com/columns"><img border="0" src="http://www.flaunt.com/sites/default/files/menu_link_list/columns_small.png" /></a></p>
</div>
</div>
Also, is there a way for the module imagemenu images url to be changed?
Let me know if I can add information to make easier to understand.
thanks,
Nick
Comment | File | Size | Author |
---|---|---|---|
#20 | cdn-rewrite_image_urls_panel_panes-1056646-20.patch | 599 bytes | acrollet |
Comments
Comment #1
Wim Leers1) Regarding CKEditor issues: please read the text over at admin/settings/cdn/other first. Most likely, the same origin policy is the cause for this problem. You may have to blacklist the CKEditor JS file. Try blacklisting all .js files for a moment, and see if that fixes the problem.
2) Regarding imagemenu image URLs: I first need to know the integration method you're using. Are you using the fallback method or did you apply the core patch?
Comment #2
naeluh CreditAttribution: naeluh commented1) I added -
*ckeditor/ckeditor.config.js
*ckeditor/ckeditor.styles.js
I just wanted to confirm that this is the proper path notation fo blacklisting a module .js
2) I have applied the core patch.
I am using the the
http://drupal.org/project/imagemenu
I created a menu using this module to use mouseover/rollover effects in the main menu and put the menu in a block
the top menu at flaunt.com
I am thinking it might have something to do with the js files that the image menu uses
thanks again any help is much appreciated
Comment #3
naeluh CreditAttribution: naeluh commentedI think it has something to do with adding images from html rather than the imce cause, the images placed in the ckeditor from the imce work and the images placed there via html do not work
Comment #4
Wim LeersAh, never mind, it's not that CKEditor is not working, it's that the image URLs are not being altered.
Well, the CDN module uses two ways to alter file URLs:
- URLs defined through all Drupal API calls: hook_file_url_alter()
- URLs in nodes: hook_node_api(), $op = alter
URLs in other pieces of content are not yet being altered. In your case: Panels. I'd welcome a patch that adds support for Panels, or you can sponsor me to add it for you. In the latter case, please contact me via http://wimleers.com/contact.
Comment #5
naeluh CreditAttribution: naeluh commentedAlright, I would love to learn how to make a patch, I have never done that before.
You would probably be able to make the changes much faster than I could.
I am more than willing to help in anyway I can. Let me know what I can do to make the process easier for you.
As far as the imagemenu module integration I will be contacting you via contact form on your site.
Thanks again for all your help.
Comment #6
Wim LeersIf you want to implement it yourself, you can ask the questions here. :)
You only should contact me directly if you want to sponsor something :)
Comment #7
naeluh CreditAttribution: naeluh commentedComment #8
Wim LeersClosing due to lack of response.
Comment #9
phpbutcher CreditAttribution: phpbutcher commentedJust in case this might help anybody else, here's how we worked around this problem. I'm not a very experienced Drupal guy so any suggestions to optimize this code would be greatly appreciated.
It basically checks to make sure the CDN module exists and is turned on. Then it goes through all the panels in the $display and uses the cdn function to change the img src tags. As I said before, I'm not a Drupal guy so this may not be an optimal solution, but I didn't find anything else in my searches so I figured I'd share. At least it will give people and alternative to changing each image src tag because in a panel.
Comment #10
jemond CreditAttribution: jemond commentedI used the code from #9 to implement CDN URL rewriting in Panels 3 custom content panes:
Is this an approach that might go into the module? If so, I'm willing to take a crack at a patch. This patch is currently on our dev server. It will be deployed live probably in December during our next release, so I can circle back and verify the patch is stable.
Comment #11
Wim LeersAny reason you can't use cdn_post_render_html_alter(), like I do for blocks: http://drupalcode.org/project/cdn.git/blob/refs/heads/7.x-2.x:/cdn.modul... ?
Comment #12
jemond CreditAttribution: jemond commentedIsn't that only in the D7 version?
Comment #13
jemond CreditAttribution: jemond commentedOne fix for the code snippet in #10:
file_create_url(&$path);
should be
$path = file_create_url($path);
Comment #14
Wim Leers#12: Yes, but in D6 you can use cdn_html_alter_image_urls(). Please use that instead.
Comment #15
jemond CreditAttribution: jemond commentedAh, cdn_html_alter_image_urls() works. I updated my snippet from #9 to use that instead.
Comment #16
jemond CreditAttribution: jemond commentedcdn_html_alter_image_urls() will not work for my needs. It looks like it assumes that the href for an A tag that wraps an IMG only links to the image itself, and not something else, so it always updates the path of the link to the CDN. In my use case we sometimes have images in custom content panes that link to internal assets on the site, like a registration page, so we don't ever want them rewritten. So I ended up having to revert to the snippet in #9.
Comment #17
Wim Leers#16 was fixed some time ago, so now you should be able to use
cdn_html_alter_image_urls()
again. If you can turn this into a proper patch, I'll commit it :)Comment #18
jemond CreditAttribution: jemond commented@wim - Turn what into a patch? The #10 refinement?
Comment #19
Wim LeersYes. But it should be possible to make it much simpler, thanks to
cdn_html_alter_image_urls()
.Ideally, it would somewhat like this:
Comment #20
acrollet CreditAttribution: acrollet commentedHere is a patch that translates html in nodes rendered by panels.
Comment #21
Wim LeersThanks!
http://drupalcode.org/project/cdn.git/commit/ccc9467
Comment #24
Wim Leersacrollet: your patch was broken, see #2114627: Image URLs in Panels' panes: preg_match_all() expects parameter 2 to be string, array given.
Comment #25
acrollet CreditAttribution: acrollet commentedWim Leers: are you expecting some action, or just informing me?