I'm editing an existing template in Joomla and I need to change the menu icons text. In Joomla Administrator, I cannot find the place where I can do this. So, in FireBug I found DIV container that I was searching for. But if I change the text in FireBug, my changes are obviously not saved. Now very basic question is: how can I know the name of PHP or HTML file, where this DIV container is located? Or how can I save my changes?
FireBug will only change web browsers content, it will not affect files on the server. If you know DIV's id you can search for files with this string on the server. To save changes - edit file and save - but on the server.
I use TestWrangler app (I'm on a mac) - open blank TW, click on Search, browse to target a folder to search through. I always search through a copy of my website folders on my hard drive rather than live site files. Search for the text string you're wanting to find which file contains it. Give TW a few seconds or more and it will tell you exactly which file contains the string.
http://www.barebones.com/products/textwrangler/
When you right click on an HTML element and select "Inspect with firebug", on the right hand side of the firebug screen you will see the styles applied to that element, and where it says the line number, if you just hover your mouse over it it will show you the exact location of the file.
Use a file search tool, it is included in most IDE's, if your editor doesn't have such a feature try a file grep tools like wingrep (http://www.wingrep.com/)
I just thought I'd share this as a possible 'answer' as well.
there is a joomla extension that enables you to search through your source code within joomla itself.
Here is the link:
http://extensions.joomla.org/extensions/miscellaneous/development/22858
I'm sure it will come in handy instead of going through the hassle of a complex setup on localhost.
Related
One of my files was "marked as text", with the icon changing. In reality this is a PHP file. I have tried going to Help -> Find Action -> Mark As to try to get it back to PHP highlighting but it doesn't work. I've deleted the .idea folder, tried to change different settings but nothing works.
What Am I missing? How can I get the PHP highlighting back?
In the project tree view right-click the file and you can toggle between Mark as Plain Text and Mark as PHP from the context menu. This works as well via Find Action as long as the focus actually is on the file entry, but not when another file in the editor frame has the focus and the target file is only selected in the tree view since this action is based on focus. Ensure you have properly set the focus when attempting to perform this action.
If the file was marked as plain text, there should be Mark as PHP in its right-click menu. If you can't see this action, this likely means that file name was added to Text file type patterns in Settings | Editor | File Types:
Removing file name from the list of registered patterns should help
I have a wordpress site with a page named domain.com/dogs. I want to change that exact page to a regular blank white page that I can type text or html in and be able to turn this feature on and off easy enough manually.
What will the name of the file be that I'm replacing it with? domain.com/dogs or domain.com/dogs.php etc? Remember I want it to be EXACTLY the same url.
Thank you so much!
You have to actually find the file that you're talking about on the server or
use GoogleChrome: Right-click(on page)>inspect element > Network (tab).... where you will find the file. The file name and extension will be shown.
Once you know the page extensions you will know what to put:
domain.com/
NOTE: This will work unless there is a masking script that rewrites the url of address bar.
Then you have to go into the server and edit the file itself, and delete all of the contents of the page. Then you can start a new page with the standard HTML headers and include the text you want. NOTE: MAKE SURE THAT YOU SAVE THE FILE WITH THE SAME NAME AND EXTENSION TO THE SAME LOCATION, this will do what I think you're trying to achieve.
I hope it helps.
Let's say, that I want to demonstrate a widget (or some HTML in a frame) that would be "injected" into another page.
For example: I want to show the people in Amazon.com that I can put let's say a ball image underneath every price tag they put on their web page. That is - I want to build a web server (or indeed a server less html web page) that would show their page and put some stuff of mine inside theirs. So it looks as if the client (Amazon.com here) has my software already installed on their server.
I am a web-dev total newbie, so if this is the simplest thing in the world please, ..
Thanks
There's TONS of special cases that can cause this to fail, but I'll present a simple way that will work for you on a decent amount of webpages(but not all).
save the webpages html source into a local html file.
edit the html source, adding a <base href="http://www.amazon.com/"> tag into the <head> element.
make any other modifcations to the page you want, such as adding new <script> tags to support your new functionality. Make sure your modifications use absolute urls.
If they navigate away from the page, your enhancements will obviously not carry onto the next page. ALso, you will have more success if you upload the file onto a web server. While a user can view the page by double clicking on the html file if they were to save it locally, differences in javascript security permissions will likely make some webpages not function correctly.
The reason you need to add the <base> tag is because the browser resolves relative urls by looking at the url in its address bar. So, if the amazon page had an image like this
<img src="logo.png">
and you saved the html and put it on you webserver at www.example.com, the browser would look for the image at www.example.com/logo.png, which clearly doesn't exist. The base tag tells it what base url to use.
If you need more automation, having them install a browser addon would be a good way to do this if your users are somewhat technical. Greasemonkey is a popular addon, and you can tell it to inject stuff into certain webpages. The benefit of an addon is that it can inject the new functionality into any page on the web, without you having to individually save and modify them. Also, it has the potential to work on all web pages, leaving their functionality perfectly in tact, opposed to the other suggestion. This is far more complicated though.
This post follows research and another recent SO post. That question was along the lines of "Is there a way on any PHP site to identify the file that contains the html that you are viewing on a webpage?" Using, for example "inspect element" feature.
It appears not. Fine. Is there a conventional way around this? From research it seems it's a security issue so with PHP you cannot.
I can login to the host using Filezilla. I want to edit my main Navigation menu. I'd therefore like to search for something like Nav, Navigation, Main menu etc but there does not appear to be a search feature along those lines.
What do developers typically do here (I am very new to PHP). How does one typically identify a file to make edits when they are working on a site that they did not create?
This might help: go into the source and find beginning of the specific piece of HTML generated for your navigation. It might be (I'm not including the closing tag because that might be generated dynamically):
<nav id="main"
or
<ul class="navigation"
Get something like Sublime Text and drag the project folder into it. Then do Find -> Find in Files (Ctrl-Shift-F) and search for that snippet of HTML.
Hopefully you should find what you're looking for.
I'm using the TinyMCE editor and imagemanager to edit pages here. For backup reasons i also have to store a copy of uploaded images in the database.
So after reading the TinyMCE doc i started editing the _Template.php file to biuld my own plugin, and it's stored in
$HOMEDIR\js\tiny_mce\plugins\imagemanager\plugins\CacheToDb\CacheToDb.php
my problem is that i want to access my common functions and classes in "my" $HOMEDIR/inc/ form within CacheToDb.php; however i have problems to point back to /inc/class_database.php from
$HOMEDIR\js\tiny_mce\plugins\imagemanager\plugins\CacheToDb\CacheToDb.php.
I tried to add the following lines on top of ChacheToDb.php
define('__ROOT__', "../../../../");
require_once(__ROOT__."inc/global.php");
require_once(__ROOT__."inc/class_database.php");
Going up 4 folders here because it's apparently included from
$HOMEDIR/js/tiny_mce/plugins/imagemanager/index.php
However, this dosnt work. Every time i try require_one() i always get an empty window when i click the "add image" button in TinyMCE, so i assume a php error message breaks the json response...? Firebug did not reveal any obvious bugs or usefull info at all.
Anyone who had this issue before and know how to include a path without breaking the whole thing?
You should have a closer look into the servers error log in order to check what the error is.