I created my own template named ibtheme, then I copy woocommerce folder from Woocommerce plugin to my template. But when I click on a product on frontpage, I see that it call the template files in plugins/woocommerce/templates/single-product, not from ibtheme/woocommerce/templates/single-product/
Please help me to override product page template!
Thanks advance!
As you have already discovered, you can edit the template files in an upgrade safe way through overrides. Simply copy it into a directory within your theme named /woocommerce, keeping the same file structure.
Example: To overide the price display template, copy: wp-content/plugins/woocommerce/templates/single-product/price.php to wp-content/themes/ibtheme/woocommerce/single-product/price.php
You can read the full documentation for WooCommerce theming at Template Structure + overriding templates via a theme
I would suggest that only copy/override the specific templates that you plan to modify. I've had to go through every single template to repair a broken theme/site after a major WooCommerce upgrade, so trust me, this will make it easier to upgrade WooCommerce in the future.
Related
I'm working with Django Material Admin framework. I want to overwrite a template(example: clearable_file_input.html) and place the overwritten template in the project folder to get the updated functionality of the template while running the project.
Where do I need to place that updated template inside the project?
What are all the changes (if there is any like updating settings.py file) that I need to do for automatically fetching the updated template but not the original template?
Example Scenario: I want to update the functionality of opening a link (of TabularInline Model) when it's clicked. I want to open the link in another tab when it's clicked. So, I got to know that I need to update the clearable_file_input.html and I successfully updated that. Now I need to figure out where do I need to place this file inside my project to get the updated functionality.
I don't want to update the original template present in the path: "./local/lib/python3.7/site-packages/material/admin/templates/admin/widgets/clearable_file_input.html"
I want to place the updated template in project so that while running the project, the updated template is taken rather than the original template present in the previously specified path.
What do I need to do for this functionality to work?
You need to override the template as answered here but in my case, I had to do three more additional step which was to use TemplateSettings renderer instead of the default one.
Step1: You need to add the following line in your django's settings.py
FORM_RENDERER = 'django.forms.renderers.TemplatesSetting'
Step2: add the following to your DIRS list in TEMPLATES config
django.__path__[0] + '/forms/templates'
Step3: add 'django.forms' in your installed apps.
That'll do the trick!
I want to implement the feature for admins to set custom templates. Like they can place themes or templates in a particular folder relative to the home folder.
Each theme may have a folder and some config or preview for example(optional).
1) First I need to figure out how to set custom templates dir for an app.
2) Then I can probably do listdir and get all the folders and then give the admin an option to select the dir.
3) A setting list to specify additonal template folders by users.
1 is the problem.
The main question I want answer for is how to set custom template dir which can be modified anytime.
I found out that askbot (the SO clone) implements this kinda theming where you can place themes in subfolders a folder and the admin can select the folder which he/she wants the templates.
I am new to Django. I guess you can do it using jinja templating.
http://jinja.pocoo.org/
Add a common styling to one html page(base.html)
and then extend the base html to whichever pages u want using extends-- check out template inheritance in the above link
Also you can get some cool templates in bootstrap.. checkout their template section. https://www.w3schools.com/bootstrap/bootstrap_templates.asp
Good luck!
I am having a hard time finding and getting a free template to work. I have tried many free templates but none of them worked properly. Currently the content of my joomla website is the default one that comes with the installation when someone chooses "Install sample data"
I always check that the template is compatible with my joomla version (3.4.3) and my php version (5.3). I also check that the template does not need other extensions or plug-ins to work.From Joomla Administration > Extension Manager I upload and install the template and then select it as default from the template manager.
But then the default navigation toolbar and many modules disappear. I am trying to understand whether apart from the template itself I also need some "Sample" content that is appropriate for the specific template, like some of the paid templates provide.
Can someone clarify to me the steps to install a free template. Perhaps provide a link to one along with instructions?
Good demo template that you can customize
http://yootheme.com/themes/downloads -> master template
or master template with demo content
If you will like it - my advise - buy good commercial template from yootheme.
I could not find any info on overriding a Joomla plugin in my template.
Some forums claimed there was no plugin override, and the Joomla documentation (being the menacing forest that it is) either has nothing on the subject, or the page is hard to find.
So how can we override the output of a Joomla plugin in the same was we override the output of com_content or mod_contact?
I have found a way to do this:
Navigate to <joomla_homefolder>/administrator/language/<your_language>/
Search for the plugin's corresponding language file.
Copy the file name, EXCLUDING the language prefix (ie en-GB.) and the .ini suffix.
In your template create a folder named html (a common practice for template overrides).
In the html folder create a subfolder and name with the language file name as you copied it in step 3.
Navigate to the tmpl subfolder in the plugin's path: <joomla_homefolder>/plugins/<plugin_type>/<plugin_name>/tmpl
Copy the view file you wish to override into the folder you've created in step 5.
Modify the copied file to override the plugins output.
For example -
To change the page navigation buttons - modify the output of <joomla_homefolder>/plugins/content/pagenavigation:
Go into <joomla_homefolder>/administrator/language/en-GB/ and find the file named en-GB.plg_content_pagenavigation.ini.
From the filename copy only plg_content_pagenavigation.
Create a folder named html (If it does not exist already) in your theme, inside it create a subfolder and name it plg_content_pagenavigation.
Copy the view file <joomla_homefolder>/plugins/content/pagenavigation/tmpl/default.php into the plg_content_pagenavigation folder you just created.
Modify the file.
Note: I have tried it only with Joomla 3.1.
The method may not work with some plugins.
Good Luck.
In joomla 3 you can override plugins output only, that's why the origin plugin must be implemented with a tmpl.
The naming convention of the folder in you [template]/html is
plg_[type*]_[pluginElement]
Template overridden native joomla plugins is only the pagenavigation.
type* : obviously there's no sense to be other than content but if it's custom plugin no one can stop you.
On a Joomla 3.1 install, I am using the Simple Image Gallery plugin and I felt the need to override it in order to add extra functionality to each thumbnail of the gallery.
I copied all of the contents of <joomla_homefolder>/plugins/content/jw_sig/jw_sig/tmpl/ into the folder <joomla_homefolder>/templates/protostar/html/jw_sig/ and I was then able to modify both the default.php file for output modifications, and the accompanying template.css file for styling modifications. This successfully overrides the plugin's output without risking issues during future updates.
Of course, this will not work with all plugins, but it offers another alternative if you have a plugin that was nice enough to be developed with a tmpl folder.
No you can't override the same way because there is not tmpl folder because plugins really should not be rendering though of course a lot do. You probably need to clone the plugin and make a the layout your want possibly using a jlayout to make it easier to manage.
Elin's answer is not quite correct for Joomla 2.5-3.x. Some plugins do render screen output and have /tmpl folders that you may be able to override. See http://docs.joomla.org/Layout_Overrides_in_Joomla
In some cases you may need to create alternative views within the plugin /tmpl folder. For example, some of the simple, newer custom content components that use JForms let you add fields to com_content articles and select a view template for each field. Then overrides for com_content are generated dynamically to display the custom fields. Each field type can be displayed in the component area through plugins, or in a module, or within the template code, but it will use the /tmpl file you selected for the field in the CCK component. If there is a way to override the different field views from within the template folder, it must require an arcane menu structure I haven't been able to discover.
I'm about to make a dynamic website in Django so that user can change the template the website is based upon....for new users, they'll have to choose a template they like from a menu, after which this is stored in a cookie for future reference. I however don't know how to do this....any ideas.
Templates are text files in a directory on your server.
The menu is a list of directories.
The specific template to be loaded is named in your render_to_response calls in each view function.
It's wonderfully quite simple and elegant.
You never need to do a template "swap". You can simply have all the templates you ever want in a template search path. All can be available to all users at all times. You just provide directory_name/template_name. All handled for you.
Don't mess with explicit cookies. Django already does this for you. See chapter 12 of the Django Book.
Use the Profiles extension and put the selected template directory name in the user's profile.
When user selects a template, store the template name/ some sort of alias in the cookie. When the user loads the page again, in the view function, check for template identifier in the cookie. If the identifier is present, retrieve the actual template path and pass it to the render_to_response function.