magento - images not showing - magento

I added a custom field for all cms pages and enabled text editor and i display the value in a phtml file.
This is working fine,but the images not showing properly,it is not evaluated,it display like as below,
<img style="float: left;" title="Incorrect method of de-coiling " src="{{media url=" wysiwyg="" faqs="" 2-incorrect-method.jpg"}}"="" alt="Incorrect method of de-coiling " width="230">
I display this content via the following code
<?php echo nl2br($post['post_content']); // display content ?>
Please help me to evaluate this content properly,I am new in magento

When adding images using wysiwyg editor button they will be relative to root/media/wysiwyg directory
img src="{{media url="wysiwyg/myfile.jpeg"}}"/>

Related

Magento2 how to upload images in image slider in the home page?

I'm new to magento2, I've been trying to create a site of my own , I decided to download a free theme called "Hidden-techies Next" and configured it in my local system, the theme has an opening image slider in the home page, all I want is to add some images in the image slider, so I went to the block where the image was placed and found out that it was a "CMS block" called "Home Slider" and then i tried to edit the image in the slider and changed it to my onw images, here's the code below
<div class="home-slider-wrapper">
<div class="home-slider-main below-padding">
<ul class="home-slider">
<li><img class="image-responsive middle-block" src="{{media url="wysiwyg/slider/next-home-banner-1.png"}}" alt="home banner"> </li>
<li style="display: none;"><img class="image-responsive middle-block" src="{{media url="wysiwyg/matt-artz-4mAcustUNPs-unsplash.jpg"}}" alt="home banner"> </li>
</ul>
</div>
</div>
But the issue i got in here is when I tried to change the image or add few more images in the slider the slider malfunctions, like the slider is no more a slider but its just few images arranged one below one and the , also if i try reverting my changes and saved them the slider malfunctions anyways, it remains the same without the next button , here's a image of my scenario
https://i.stack.imgur.com/pyded.png
what I want in here is just to add some images into the slider, please help me out on my mistakes, idk what or where I did my mistakes, thanks for any reply's.
Please Go to Admin -> Content -> Pages -> Edit you page.
After that in content tab please click on Show/Hide Editor and check there is some script code available or not if there not then maybe possible you removed slider script code.

Pass image in yield section in laravel

For the <title> I've followed this SO answer This is working perfectly for part but the image is not working
Laravel dynamic page title in navbar-brand
But, Here when I try to make an image dynamic instead of title it's giving me a text instead of an image.
For instance,
header.blade.php
#yield('image')
In another blade, I called image as in section
#section('image', '<img src="http://localhost/appname/public/front/images/heading.png">')
Every page has a dynamic logo so I want to put logo dynamic the same like we're doing in the title.
But the result I'm getting is
<img src="http://localhost/appname/public/front/images/heading.png">
You can do like this
#section('image')
<img src="http://localhost/appname/public/front/images/heading.png">
#endsection

Magento: image file extension has %20 appended on to it when using WYSIWYG

when inserting images using the WYSIWYG in a page in the back-end, the image file extension has %20 appended on to it (which i believe is a space), if you click the hide editor button to view the HTML it will look like this
<img src="{{media url="wysiwyg/example.png"}}%20" alt="" />
Clicking insert image from the html source view inserts the image fine, it's when i'm in the actual wysiwyg editor the problem occurs.
After I've selected my image and inserted it i'm taken back to the popup box with the "Image URL" field in the general tab. It's here that a space is getting added on to the end of the file.
http://example.com/index.php/admin/cms_wysiwyg/directive/___directive/rfe33fSB1cmw9Ind5c2l3eWcvQ3wfwfer43cifX0,/key/rufheufuh4uh42eaf7611b26e2e1x1786/
Above is an example url from the image url field and a space is getting added after the last forward slash resulting in the %20, therefore not displaying my images.
Where can i trim this value as that will probably fix it?
Thanks for any help.
Try to use this:
<img src="{{media url="wysiwyg/example.png" _query="%20"}}" alt="" />
Or maybe:
<img src="{{media url='wysiwyg/example.png'}}%20" alt="" />

Magento Commerce - Use new image type on front page

I added a new image type to the image uploads called featured_banner_image. If a product is marked as featured I have a jQuery slider that will pull the featured_banner_image on the front page.
The problem is that
<img src="<?php echo $this->helper('catalog/image')->init($_product, 'featured_banner_image')->resize(135) ?>">
does not work. What code can I pull to grab my new image?

Joomla show subcategory image on category page?

Is there a way, beside creating yet another MYSQL connection, to retrieve subcategory image while browsing parent category page?
For example:
Main category (set as category as blog)
Subcategory 1 (image set in Basic options image field)
Subcategory 2 (image set in Basic options image field)
Subcategory 3 (image set in Basic options image field)
....
Now, when i browse 'Main category', it display categories title and description of subcategories, but I cant find any 'normal' way to retrieve image that i set in basic option.
The only way that I can make to work is to create another MYSQL call and retrieve image from database, but I would like to know if there is another more effective way.
Im using Joomla 2.5.
Thanks!
I suggest you override the output of the content so that you can add some code to output your images.
Copy:
joomla/components/com_content/views/category/tmpl/blog_children.php
To:
joomla/templates/yourtemplate/html/com_content/category/blog_children.php
Then edit your new override file, just below:
<span class="item-title"><a href="<?php echo JRoute::_(ContentHelperRoute::getCategoryRoute($child->id));?>">
<?php echo $this->escape($child->title); ?></a>
</span>
Add:
<div class="item-image">
<?php echo '<img src="'.json_decode($child->params)->image . '" />'; ?>
</div>
See Joomla docs for Component Output Types and Layout Overrides.

Resources