How can I find the file some element is loaded from? - php

I manage a website which is based on Drupal CMS. I have FTP access and I want to modify the structure of the header.
I know that the header is loaded from separated php file but I don't know what is the path to the file and how to find it in FTP.
Is there any way in Chrome dev tools to find the path to the file and is there a general way to find the files from which some part is loaded?

Check under "Appearance" from admin menu what theme is used and download whole theme over FTP. Themes should be in sites/all/themes dir. Then search the theme files and change what you need.
I don't think that browser can be aware of theme structure since it receives the whole pages and it can not know how page html is built on server side. There is an drupal module called Theme developer which can help you with that:
https://www.drupal.org/project/devel_themer
Unfortunately it exists only for Drupal 6 & Drupal 7 - not sure what version of drupal uses your site.

Related

Is it possible to use WordPress theme preview as main website source that will work all functions?

I'm new in WordPress
I misunderstand one thing about the theme use in WordPress
For example, I wanna create the as same website as this I purchased this template.
But when I installed the theme in WordPress it shows me the default Index.php file with little info, used my purchased theme
And when I purchased the theme there exist all src files of the above website.
How I can use my purchased src files of website that will work all function for ex: logins with db?
Thanks in advance!!!!
After you purchased the theme, you probably have just installed the theme and haven't created any pages or tweaked any settings. So if you want to get the same look as that of the preview website, you probably have to check whether the developer has provided any dummy data for importing.
Most of the themes listed in ThemeForest would have the option to import dummy data, so that customers would be able to install some pre-made posts, pages, config, etc. This might be there inside the custom settings page(as a single button to download the content) of the theme, or maybe they have provided it in separate XML files for you to import. If the files you have downloaded doesn't have it, make sure you downloaded All files & documentation. Here's a sample screenshot:
My guess is that you might have only downloaded using the Installable WordPress file only option.
If you are still unable to get the dummy data, probably you have to ping the support of that theme asking them to provide the dummy data.

How to load my plugin file on joomla's back-end?

I have developed a joomla extension and want to load a php file within my extension directory onto joomla's back-end (Admin page).
For developing the extension, I have followed the developer document of joomla and install it on an instance of joomla. It located at administrator\components\com_myextension as the picture below:
Note: The root folder of joomla is jStore
For my intention, to achieve the result I have to define the behavior in xml file so that myextension.php file can be included whenever admin page viewed or to write a function to include myextension.php file when my extension installed. Neither way I don't know how to do that yet!
In conclusion, what I want to achieve is to load the file myextension.php whenever joomla's admin page loaded. And this must be automatically.
Regards,
Dung Tri
I have figured out a new way to run a php script after my plugin activated.
The way is to develop a system plugin for Joomla. The system plugin support some functions that can automatically run when admin page is viewed like: onAfterInitialise, onAfterRoute, onAfterDispatch, onBeforeRender.
You can see a tutorial at docs.joomla.org/J3.x:Creating_a ... for_Joomla and download sample project at github.com/joomla/joomla-cms-examples

Move from Joomla to custom site

I got thrown this task because no one in my company understands websites, but I have only worked with very basic sites before, so I need help please. I haven't found another question quite like this one.
My company has an established site, running on Joomla 2.5, hosted on GoDaddy. They recently commissioned a company to build them a new site (not Joomla based), but want me to put it up on GoDaddy (saves money). The design company sent me a zip file, and GoDaddy told me to just move all the current site folders into one single folder, then unzip the site in the Public folder.
This is what I'm seeing in cPanel.
And this is what I see in FileZilla.
Do they really mean for me to move ALL these files to one folder? Or are there some I shouldn't touch, like the public_ftp folder? Or only move the files in the Public_html subfolder? Or only move files that are not in any folder?
Please be descriptive, I'm very new. Thanks in advance.
Joomla directories names are very intuitive. For most of them, you can guess the folder content just seeing it name. Basically we have these folders:
Any folder or file does not belong to joomla and therefore you should not move to the new subdirectory.
No changes are required in the database, so that all continue working on www.domain.com/oldweb
root: this is the directory where you made your Joomla pack extraction. When you first place Joomla on your web site, the root directory contains an index.php file that will run the Joomla installer. Once installed Joomla, this index.php page will detect your settings in the configuration.php file and execute your main Joomla engine.
administrator: In this directory you find all files for your Joomla administrator web interface (components, templates, modules, plugins, etc). The Administrator interface itself is a Joomla web site, and has a complete user interface that can be augmented by administrative extensions.
cache: This folder holds Joomla cache files. To accelerate performance, Joomla will cache popular pages requested in this directory, so they don’t have to be re-downloaded by PHP and MySQL for each time it is requested.
components: This directory holds all Joomla components, accept those for your administrator interface. By default, Joomla has some components available, such as login, newsfeeds, poll, registration, search, and others. They are ready to go, and can already displayed them in your website front-end.
images: This folder by default holds images used for your extensions. It contains all bitmaps used by the administrator interface as well as images that have been uploaded to present with article content. Within it you find the \smiles folder that contains emoticons; the \stories folder that has images; and the \banners folder that holds some sample banner files.
includes: In this directory you find core files of Joomla. It contains PHP execution files that automate inclusion of content.
installation: This folder contains needed files for Joomla installation. It should be deleted after installed Joomla.
language: This folder holds all language files. Joomla stores translations in a simple INI-based file format. All languages files are contained in it own folder and have filename prefix that matches the folder name. For example, all language files for English template from the country Great Britain are stored in a folder named eng-GB and all of them has a prefix eng-GB.
libraries: this directory holds your entire Joomla system and third-party libraries used in your website. A Joomla website uses the core libraries contained inside the \libraries folder. Within this folder you find the \joomla folder where you will see different implementations areas (such as file system, application, database, etc). These implementations make up the functional parts of your application. Its library has its own subfolder in this folder to aid in organization.
logs: Where Joomla stores its log files.
media: Default folder to store media files. It may contains files related with user interfaces, such as: JavaScript libraries, flash files, etc.
modules: This folder contains all installed front-end modules. It holds the modules available for display by a template. By default Joomla comes some modules, such as banners, breadcrumbs, latest news, login, newsflash, poll, random image, others. Modules are placed like panels into a Joomla template. They often encapsulate or provide the front-end display for related component. Like a component, a module is a type of add-on extension.
plugins: It contains all your plugins files. As well as components and modules, plugins are a type of add-on extension. However, they work at a lower level than components.
templates: This directory has all your frontend template files. You can notice that the name of each template subfolder must match the template it contains. By default Joomla brings some templates already done, and ready for use.
tmp: This folder stores temporary files and cookies that are used by the administrator and user interface of Joomla. Most of time, extensions’ files are copied to this folder during Joomla installation process.

Modifying Joomla html5 module chrome

I want to modify the module chrome for the Joomla custom html module. I understand that I can simply overwrite it or create an alternative chrome by creating a modules.php file in my template html folder. However, I have no idea where I can find the code for the existing, standard Joomla chromes so that I can modify them - does anybody know where the standard chrome php/html markup files are located or generated in the file system? Of course I could write it all from scratch in theory but I just want a slight variation to the existing html5 module and I would like to see how it is constructed to learn from it. Anybody got any clues where t can be found in Joomla 3.1? The documentation is sparse on the matter.
You can use the system modules.php file that comes with joomla as a starting point for your own module chrome. It is located under the templates/system/html/modules.php
For the custom html module overrides:
Copy the default.php file located under the /modules/mod_custom/tmpl/ directory over to /templates/yourtemplatename/html/mod_custom/ directory.

Drupal php file in theme

Under the path "\sites\all\themes\fusion\mytheme\", I found that some php file called "taxonomy_term_page.tpl.php", "views-view-fields--product-brand-category--block-2.tpl.php"... will generate some specific content on specific page, how can I configure this php file to specific link/block or whatever?
Yeah it would be a bit long to explain what to do with regards to what each file does. You would need to play around a bit and see how it all works.
I would recommend that you check out:
http://drupal.org/theme-guide/6
and read up on how the theme system works for the Drupal version that you are using.
but for example the "taxonomy_term_page.tpl.php" would be used to change the output of content that you would visit for a taxonomy term that you created.
eg. mysite.com/taxonomy/term/ which might be mysite.com/cooking-books/italian-pizzas
and the "views-view-fields--product-brand-category--block-2.tpl.php" would be for theming the output to one of your views which is configured to output as a block...
I'm happy to answer any more of your questions
You aren't going to be able to configure a specific file to fill the role for a specific theme (the files are picked by their file name for their purpose).
You should check out the devel module (specifically the theme devel module), which can tell you what parts of the output are expected in specific files. I'm not sure if the themer module is still in devel for 6.x, but if it isn't, try the devel_themer module.

Categories