How to change image paths in Redactor editor? - redactor

I use Redactor editor in CraftCMS for blog posts. When I insert images in Redactor the URLs are wrong(relative paths) on details blog page and even in Redactor editor in CMS, missing a / before the upload directory where the images are uploaded.
How can I add a slash at the beginning of URLs or set them to use absolute paths?
The URL for blog posts looks like www.website.com/blog/post-name
This is my json config for Redactor:
{
"buttons": ["formatting", "bold", "italic", "unorderedlist", "orderedlist", "link", "image", "video", "html"],
"plugins": ["fullscreen", "video"],
"linkNewTab": true,
"toolbarFixed": true,
"imageFigure": false,
}
Thanks.

First you should check that your Redactor field is set up to use your image asset volumes:
If it is then the issue is not with Redactor, but with the settings for your asset volume. File system paths to images, and their URLs are determined by the settings on your asset volume:

Related

Wordpress: Using relative URLs in the Menu using Custom Links

When I try to use relative URLs when creating menus in Wordpress...Wordpress always prepends "http://" to the relative path after I click Save. How do I prevent Wordpress from prepending the "http://" in the URL field?
I think I read to change a bit of code in wp-includes/nav-menu.php, but I'd prefer not changing any core code...just in functions.php if necessary.
Any ideas?

How to change defaults for featherlight.js Wordpress plugin?

When using featherlight as a wordpress plugin, how can I change default options without breaking theme, etc.?
I see that the only js loaded on my page is
/wp-content/plugins/wp-featherlight/js/wpFeatherlight.pkgd.min.js?ver=1.3.0
Currently I need to add all these attributes to every link:
data-featherlight="iframe"
data-featherlight-iframe-frameborder="0"
data-featherlight-iframe-allow="autoplay; encrypted-media"
data-featherlight-iframe-allowfullscreen="true"
data-featherlight-iframe-style="position:fixed;background:#000;border:none;top:0;right:0;bottom:0;left:0;width:100%;height:100%;"
...which is a lot of repeated overhead. How can I set these as defaults for all my iframe lightboxes?
You can set defaults globally like this:
$.extend($.featherlight.defaults, {
type: "iframe",
iframeFrameborder: "0",
iframeAllow: "autoplay; encrypted-media",
iframeAllowfullscreen: "true",
iframeStyle: "position:fixed;background:#000;border:none;top:0;right:0;bottom:0;left:0;width:100%;height:100%;",
});

What is the way to upload bulk images in wordpress?

I have more than 500 images and I want to upload in WordPress media, I tried through FTP, WordPress changed images in different dimensions, and when I installed plugin "ADD TO SERVER " it uploads all the files.
I just want to add original images in the WordPress dashboard. Is there any way to upload bulk files in the WordPress media?
You can do it through FTP but go to settings before and change to import ORIGINAL size instead change dimensions.
You can find it under SETTINGS --> Media.
I have use 1024/1024 as max to avoid overload the server. You can change it on 2K(2048) or 4K(4096).
You can use the intermediate_image_sizes_advanced hook to prevent WordPress from getting the list of image sizes it normally uses.
The following code will feed an empty array to WordPress instead of the registered list of image sizes:
add_filter( 'intermediate_image_sizes_advanced', function(){
return [];
}, 10, 2 );
Running the Add to server plugin again after adding that code to your functions.php should not resize your uploaded images.

wordpress gallery: Is there a way/pluggin allowing two or more native galleries in one page?

We are creating a wordpress-based project, but we came to an issue where we need to add two or more native wordpress galleries (to keep the fancybox plugin viewing). So is there a plugin/way how to add more native galleries into one wordpress page?
PS: We tried nextgen, but then the large view opens 2 times 1time fancybox 1time nextgen gallery ... So theoreticly it would be enaugh to turn off the nextgen viewing, but keep the nextgen gallery generation but the question is how?
PS2: We found a half-solution - you can add two [shortcodes] with image ids like
http://codex.wordpress.org/Gallery_Shortcode but this way you can click through to all these galleries - but our goal is two click through only in each gallery itself.
I found the solution it IS coding, but just a little ;-) :
make a specific CSS class e.g. .mySuperGallery01
into your page, insert a gallery shortcode e.g. [gallery link="file" size="medium" ids="332,330,331"] that list of ids are ids of images uploaded through the media...
wrap the gallery shortcode with your e.g. div class like this:
<div class="mySuperGallery01">[gallery link="file" size="medium" ids="332,330,331"]</div>
For every shortcoded gallery wordpress will create an id #gallery-X where X is the order-number of your gallery on your page (#gallery-1, #gallery-2, #gallery-3,...)
Now go to settings => Fancybox for WP => Extra Calls
check that the "Additional FancyBox Calls" option is checked (turned-on)
Link through jquery to the galleries and add a groupNUMBER to each link but a different one for every next gallery by putting this into the textarea: $('.smallerGallery01 #gallery-X a').attr('rel','groupNUMBER'); one gallery = one piece of this code... just change the X and a NUMBER to the same value for every gallery example: $('.smallerGallery01 #gallery-1 a').attr('rel','group1');
$('.smallerGallery02 #gallery-2 a').attr('rel','group2');
Last thing you need to do is to actually "play" the fancybox on your class by inserting e.g. this code to the textarea:
jQuery(".smallerGallery01 a").fancybox({
'cyclic': false,
'autoScale': true,
'padding': 10,
'opacity': true,
'speedIn': 500,
'speedOut': 500,
'changeSpeed': 300,
'overlayShow': true,
'overlayOpacity': "0.3",
'overlayColor': "#666666",
'titleShow': true,
'titlePosition': 'inside',
'enableEscapeButton': true,
'showCloseButton': true,
'showNavArrows': true,
'hideOnOverlayClick': true,
'hideOnContentClick': false,
'width': 560,
'height': 340,
'transitionIn': "fade",
'transitionOut': "fade",
'centerOnScroll': true
});
9)Dummy entry: Of course you have to click the save changes button ;-)
NOTE: I recommend you to go step by step especially through the jQuery settings
ADVANTAGE: Since you have a specific class, you can also make specific styles just for your new-style gallery :)

Adding a new font in magento admin panel

we have list of fonts available in the text editor of magento using which we can create cms pages.I need to add a new font to that, is it possible.?
You can add the font options via the tiny_mce editor_template.js file:
File: js\tiny_mce\themes\advanced\editor_template.js
Variable: theme_advanced_fonts
Tinymce Config

Resources