I am using Opencart 1.5.3.
In Catalog->product I want to use edit icon/image instead of edit in text. I am not getting how to do it. Please help me where i should change this.
Thanks
You'll need to open
/admin/language/english/english.php
Find
$_['text_edit'] = 'Edit';
And change that text to the html you wish to use for your image, such as
$_['text_edit'] = '<img src="view/image/edit.png" alt="Edit" title="Edit" />';
Related
I have made some changes to add caption to opencart owl carousel , I am using title input to store some captions that contains html codes .
Opencart strips input html codes and then shows them as plain text.
How can i prevent Opencart From stripping banners title input?
try this:
$my_banner_caption = html_entity_decode($my_banner_caption, ENT_QUOTES, 'UTF-8');
I don't know much about HTML or imacros.
I'm trying to make an imacros script that takes a screenshot of an image on the page, but the website has a navigation bar which when imacros takes the screenshot covers half of the image.
How can I create an imacros script to remove this navigation bar from my screen?
In inspect elements, I can get rid of it by removing:
So how can I remove this in imacros please?
Thank you
Use Javascript for this.
To remove element by ID use this code.
var id = window.document.getElementById("page-container");
id.parentNode.removeChild(id);
Instead of "page-container" put your ID you want to remove
To remove elements by class
Use this:
var collection = window.content.document.getElementsByClassName("Class-name");
Array.prototype.forEach.call(collection, function(node) {
node.parentNode.removeChild(node);
});
It's possible with imacros and url goto as iim script. Or you can use pure javascript as js file in your imacros.
Example with url goto and class name:
URL GOTO=javascript:var<SP>delclass=window.content.document.getElementsByClassName("class<SP>name");Array.prototype.forEach.call(delclass,function(node){node.parentNode.removeChild(node)});
I'm using tinymce as rich text editor and separate excerpt from content via pagebreak button that insert a <!-- pagebreak --> tag . I'm wondering what is the best way to extract excerpt from database.
I know i can use preg_math as well as preg_split , but is it realy best and optimized solution?
wouldn't it be better and faster to save excerpt in a separate column?
This should work, without using any regex functions:
$pagebreak = '<!-- pagebreak -->';
$content = 'I am the excerpt<!-- pagebreak -->I am the rest of the content';
$excerpt = substr($content, 0, strpos($content, $pagebreak));
$restOfTheContent = substr($content, strpos($content, $pagebreak) + strlen($pagebreak));
var_dump($excerpt); // string(16) "I am the excerpt"
var_dump($restOfTheContent); // string(28) "I am the rest of the content"
Please note that this is really only designed to work with a single page break. It wouldn't be too difficult to modify it to generate an array of $pages based off of the string $content should multiple page breaks be necessary.
I have the following output.
<img width='70' height='70' class='centreimg' src="http://localhost/aktivfitness_new/assets/images/centre/centre1.jpg" />
There are same outputs with centre2.jpg etc.
Now I want to replace this centre1.jpg to hover.jpg when I hover.
But when I use the following it becomes centre1hover.jpg
$(".centreimg").mouseover(function() {
var hoverimg = $(this).attr("src").match(/[^\.]+/) + "hover.jpg";
...
Something is wrong with match(/[^.]+/) + "hover.jpg part.
How can I do this?
Thanks in advance.
Don't you think this would be easier:
var newSrc = oldSrc.replace(/[^\/\.]+\./, 'hover.');
Anyway: you shouldn't use Javascript for hovers =) If there is another way: use it. Not only is it a bad practice, it's also not user friendly: when the image loads when you hover, the user will see a 'flash' because the entire image still has to be loaded = not pretty.
string: "Here is the badges, https://stackoverflow.com/badges bla bla bla"
If string contatins a link (see above) I want to parse the website title of that link.
It should return : Badges - Stack Overflow.
How can i do that?
Thanks.
#!/usr/bin/perl -w
require LWP::UserAgent;
my $ua = LWP::UserAgent->new;
$ua->timeout(10);
$ua->env_proxy;
my $response = $ua->get('http://search.cpan.org/');
if ($response->is_success) {
print $response->title();
}
else {
die $response->status_line;
}
See LWP::UserAgent. Cheers :-)
I use URI::Find::Simple's list_uris method and URI::Title for this.
Depending how the link is given and how you define title, you need one or other approach.
In the exact scenario that you have presented, getting the URL with URI::Find, HTML::LinkExtractor etc, and then my $title=URI->new($link)->path() will provide the title and the link.
But if the website title is the linked text like badged, then How can I extract URL and link text from HTML in Perl? will give you the answer.
If the title is encoded in the link itself and the link is the text itself of the link, how do you define the title?
Do you want the last bit of the URI before any query? What happens with the queries set as URL paths?
Do you want the part between the host and the query?
Do you want to parse the link source and retrieve the title tag if any?
As always going from trivial first implementation to cover all corner cases is a daunting tasks ;-)