Where are the templates for the default pages in Silverstripe 4? - php

Where are the templates for the default pages (Home, About Us, Contact Us) in Silverstripe 4 when freshly installed? The documentation does not say where.

They're called Page.ss and Layout/Page.ss, and will be located in whichever theme you've installed. If you don't have any themes yet then there won't be any yet.
If you don't have any themes it will use templates/SilverStripe/Control/Controller.ss.
Bonus: you can enable SSViewer.source_file_comments via YAML configuration to have HTML comments added to the rendered page source code, showing which templates are being used.

Related

Why can't I get an override template to work?

I recently had a task dumped on me, all I need to do is add a link header to a template in joomla. I'm able to do this directly inside the default.php in
/modules/mod_articles_category/tmpl/default.php
but of course it shows up in any module that uses that template, which isn't acceptable.
I havn't touched joomla before yesterday and I'm suprised at how painful this has become!
I've been following tutorials, creating an override template in
templates/template_name/html/mod_articles_category/default.php
but I dont see any option to utilize this override template in the module options of the admin console.
I also tried creating a duplicate of the module itself with the link header simply added into the default.php file but don't have any option to have this module installed since there is no module manager extension, just barebones joomla 3. What I'd like to do is use the override template, since it seems like the simplest solution.
What am i doing wrong that I cant see any effect from my override template?
Rename the file templates/template_name/html/mod_articles_category/default.php to something custom like templates/template_name/html/mod_articles_category/linkInHeader.php then save it.
Go to your module manager and open that module. GO to Advanced tab & select linkInHeader in Alternative Layout dropdown. This should do the tricks.

Issues regarding custom theme, plugins not working in Magento

I am using magento custom theme. When I open my product page, while loading the page the default zoom function buttons are visible for a moment. When page load completely the buttons are disappear.
Let us look the images for more info:
Before (while loading)
After page load
Why this happened so? I am installed a new custom theme. This theme not provide any image zoom functionality. I think the zoom buttons are load from frontend\base\default\template\catalog\product\view\media.phtml. Why my site load this page, since I use a custom theme the site should use the theme's media.phtml file. How can I solve this issue?
And when I try to install some product zoom plugins, these are not working in my theme. The plugin files are saved in my default theme directory. And I manually copy the plugin files from default to custom theme directory, but no luck. Please refer the LINK for more details. Is there any way to rectify this?
Please help me ...I am using magento 1.9.0.1
First of all you need to check which package you are using for you theme, you can check if media.phtml is being called from rwd folder.
i.e. /app/design/frontend/rwd/default/template/catalog/product/view
Or you can enable path hints and locate the phtml files, and accordingly that you can put the design files of custom module there.
To turn on template path hints in Magento:
log into the magento back-end admin.
Go to System -> Configuration in the main menu.
Go to Developer on the bottom left under ADVANCED.
Switch to the store view on the top left to your current website or store
view.
or check the below link.
https://support.sweettoothrewards.com/entries/21255937-How-do-I-turn-on-template-path-hints-

WordPress Redux Framework - Redux admin folder can't find plugin

I'm trying to get the Redux Framework working with my "blankslate" theme. I installed the plugin (downloaded the latest zip for Redux). Then I used the Redux Builder tool to create an admin folder. I copied the admin folder to my themes folder. The Redux menu item was successfully added to WordPress' left nav (in my case I named it CMS) and all the fields work and can be saved. But there is constantly an error that says "This theme recommends the following plugin: Redux Framework." Redux is obviously installed, so how can I get this error to go away? I'm sure there's just a configuration option somewhere that needs to be set.
The issue here is you are loading TGM before Redux has had a chance to load. Delay calling TGM until after a hook like this:
add_action('plugins_loaded', 'tgm_init_function', 25);
This will force all the plugins to load before it tries to run TGM. My guess is your plugin is named higher in the alphabet than Redux, and thus it's loaded first. ;)

How do you give your custom magento theme its own area in the configuration?

I'm new to magento theming, I have just finished my first theme. However a lot of the content is static on the pages. Such as some links in the footer, slider, etc. What would be the best way, in terms of distributing the theme to others, to have them edit this information in magento, either as a configuration area, static blocks, widgets, etc.
How would I make a static block and have it be installed in magento when the theme was installed?
How would you make an area in magento configuration where users can customize some options in your theme?
You probably know about the database install scripts you can create for a module inside the modules sql directory, but from 1.6 CE up you can also create data install scripts inside the data module directory which allows you to do exactly the kinds of things you want to on install - so you can use it to create a static block. There is a quick summary here. A limitation here is that the theme would be restricted to versions of Magento CE from 1.6 and up only. Also have a look at the data install scripts from the Mage_Cms module data directory in 1.6+.
Below 1.6 and you would have to manipulate the database directly using database install scripts which is not an elegant solution and I wouldn't recommend it.
With regards to having the user configure options for the theme, have a look at adding a system.xml and optionally adminhtml.xml (as this content can also be put into config.xml) files into the modules etc directory along with the config.xml. system.xml allows you to add new tabs and pages with configuration options into the system -> configuration section of admin, and adminhtml.xml allows you to configure acl for those menu items. Have a look here.

Understanding Joomla Structure

I am new to Joomla and can't help but notice the difficulty in understanding page structure.
Right now the website has a page for example: domain.com/index.php/aboutustab
So it seems index.php is required to render all pages and the "aboutustab" seems to be an article but i can't find where the content in the aboutustab is being pulled from and how?
I looked into Article manager but the content is not there.
By content i mean all the text that is suppose to show up and etc.
You should start by reading everything in the beginners section of the Joomla docs located here.
What you're seeing is a menu option, not an article. Read the docs, they really do help.
In Joomla 1.6/7/2.5 the index.php is shown if you haven't enabled Joomla! "Search Engine Friendly URLs" option in the SEO Settings panel in the Site tab of the Global Preferences.
In conjunction with using the "Use URL rewriting" (which requires you to enable either the Joomla! .htaccess file on Apache servers or the web.config file on IIS7 servers) these settings remove the index.php from the browsers location bar. Joomla! still passes everything through the index.php but it's not visible to the end user.
The content you're seeing would typically be in an Article but it may not have the same title as that displayed on the website - the title can be over-ridden in several places. The other possibility is that it's in a Custom HTML module, which is essentially a mini article that you can place in module positions.
As for page structures, they are controlled by the active template (a template is a set of php, css, js and image files in a directory, usually of the same name as the template). A template typically provide a core content location (called the component area) and a variety of module positions. Most Joomla! templates support a variety of standard module positions including top, header, footer, copyright, user1...user5 etc.
The page is assembled by pulling together all of these elements (articles, modules, etc) and inserting them into the template.
HTH
Craig

Categories