I can't find the proper css in joomla - joomla

I need to modify the width of each column in a 2 column custom theme and can't find the place to do this. I tried using firebug but no luck. I looked over the main joomla css (didn't quite expect it to be there), and the theme template.css.
I'm sure veteran joomla programmers have ran into this plenty of times and this is an easy solve for them :P
I just need to know the places to look.
Thanks.

If you're using firebug and you still can't find the path to the css file, may be you have some kind of plugin or template that packs all your style sheets into a single file?
If so, you should disable it, clear your cache, then try again with firebug, and once you find where is the css file located, enable the plugin / template feature again.
If you still can't find it, can you post the url here to take a look?
I hope it helped!

Maybe there's no css for this.
Sometimes the width of columns in articles is inside de template itself like this:
<td valign="top" width="<?php echo intval(100 / $this->params->get('num_columns')) ?>%" class="article_column<?php echo $divider ?>">
<?php for ($y = 0; $y < ($this->params->get('num_intro_articles') / $this->params->get('num_columns')); $y ++) :
if ($i < $this->total && $i < ($numIntroArticles)) :
$this->item =& $this->getItem($i, $this->params);
echo $this->loadTemplate('item');
$i ++;
endif;
endfor; ?>
</td>
To find something like this code look into:
template folder/ content/ com_content / the view you want to edit (i.e. : section view, category view etc)...
Also if you use Firebug or Webkit Inspector you should see the inline style as a result of this code.

If you use firebug, you should definitely see the path of the particular css. Just right-click on some column -> click on inspect element and then you see the css path on the right-hand side.
If your column styles are set inline, you will have to modify the right template for this. Its probably your index.php in your themes root folder or some template in the html folder.

Related

Adding an image from within a child theme on Moodle 3.11

So, I'm new to Moodle and I'm creating a custom theme (child theme of Boost).
I'm a attempting to insert an image from the pix directory into the footer template - however I can't seem to get it to output any paths.
I've tried following the Moodle Docs - creating a directory mytheme/layout/footer.php and adding:
$templatecontext = [
'imageone' => $OUTPUT->image_url('mylogo', 'theme'),
];
echo $OUTPUT->render_from_template('theme_mytheme/footer', $templatecontext);
then including the following in my mytheme/templates/theme_boost/footer.mustache:
<img src="{{{imageone}}}" alt="Please give your image alt text or set the role to presentation" width="50" height="50">
However, all I get is the alt text and blank src.
I assume I'm doing something silly - but I'm not familiar enough with the Moodle context/output/renderers etc. to troubleshoot much further than I already have. And the documentation is not the greatest!
Thanks for any pointers!
You are reading theme_mytheme/footer mustache and you have changed theme_boost/footer.mustache (overrided in your theme nonetheless).
CHange
echo $OUTPUT->render_from_template('theme_mytheme/footer', $templatecontext);
to
echo $OUTPUT->render_from_template('theme_boost/footer', $templatecontext);
and then you can keep your example of mustache template

Processwire Add css class to page

I there a possibility to add a classname to a page?
I can't figure out how to implement such feature or if it already exists.
I'm using Processwire 3.0.42.
Put something like this in your template where the body is:
<body class="<?php echo $page->template->name; ?>">
That will give your page body tag a class equal to page template name.
You can add a page title in the same way.
<body class="<?php echo $page->name; ?>">
Don't be worried about adding a class to every page. The overhead of doing this is negligible.
If you wish to add a different class you would need to add a field to your template and append it to the code above.
As always in ProcessWire, everything is under your control. Alternatives to #ivangretsky's perfectly good answer would include-
Simply include a conditional in your template file. (This doesn't scale well if you need to add other classes to other pages using the same template.)
<?php
$bodyClass = '';
if($page->id == 1021) $bodyClass = 'my-class';
?>
<body class="<?php echo $bodyClass; ?>">
NB Using $page->id is better than $page->name, for example, as the ID doesn't change while the name could.
You could also add a field to the page template definition. Add a field called something like 'Body Class'. Then use the content of that field in your template file.
<body class="<?php echo $page->body-class; ?>">
This will scale better than my other suggestion, and there are options in the ProcessWire backend to hide or partially hide the field during normal use if you don't want users messing with its value.
One 'gotcha' from the CSS spec to be aware of is that CSS identifiers, including class names and IDs cannot start with a digit, so you cannot just use $page->id.
There are lot of options and it depends on your needs and maybe imagination :-).
You can use page name, template name, page id, or maybe combination.
<body class="<?php echo $page->template->name; ?> page-id-<?php echo $page->id; ?>">
// Output
<body class="your-template-name page-id-1234">
This way you can target template, page, or both.
Or, as mentioned by #ivangretsky, you can add custom field to page. And again, you can combine this aproach with template name, etc.
It depends on your needs and what you want to achieve.
Notice:
Using $page->id is better than $page->name, as the ID doesn't change while the name could. #DaveP

How to edit the source code of joomla individual pages

I have a Joomla site, and I want to remove a the footer div from a page without it affecting it on the other pages. Please is there a way I can do it.
You have a couple options - you should be able to set additional CSS on that article to hide the particular footer div for that one individual page without issue.
Additionally you could install a plugin like Sourcerer that allows for PHP coding directly into articles in Joomla! (which comes in REALLY handy!); then you could remove it programmatically as well if necessarily.
Alternatively - you could create a template override for that particular template/page and edit the PHP there to reflect appropriate course of action for that URL/Page.
I tried to list them in order of easiest to most difficult.
It´s not a clean method to hide template-elements by using CSS (display:none). And for your intension you dont´t need a external plugin.
Try a page-option in your template index.php.
First - to get page-options work:
<?php $pageoption1 = JRequest::getVar( 'Itemid', '' ); $pageoption2 = JRequest::getVar( 'page', '' ); $pageoption3 = JRequest::getVar( 'option', '' ); ?>
And further:
<?php if ($pageoption1 == '1') { ?>
This text will be visible only in the page with Menu Item ID 1
<?php } ?>
This works lately in Joomla 2.5.X - for newer version i think it will also work fine.

Changing the position of Joomla 3.2 tags

I have added some tags and linked these to an article. On the front end the tags appear on top (i.e. before) the article text. Instead I would like to display them at the bottom (i.e. after) the article.
I assume I have to make an override of layouts/joomla/content/tags.php
Create a Template Override for the following file:
components/com_content/views/tmpl/default.php
Once done, open this file in your override location and go to line 157 and you will see the following:
<?php if ($params->get('show_tags', 1) && !empty($this->item->tags)) : ?>
<?php $this->item->tagLayout = new JLayoutFile('joomla.content.tags'); ?>
<?php echo $this->item->tagLayout->render($this->item->tags->itemTags); ?>
<?php endif; ?>
Move this section of code somewhere futher down in the file to suit your needs
Hope this helps
This can be easily achieved by simply changing the Position Of Article Info to "Below" in Options Tab in Joomla Menu. The Joomla menu has to be of Type "Article"
No need to create any override.
Hope this helps.
See attached screenshot.

Where does VM derive code for $file_list?

Can someone tell me where the code for $file_list is sourced in Virtuemart? To be specific, in the flypage.tpl.php file, there is a snippet of code that looks like this:
<span style="font-style: italic;">
<?php echo $file_list ?>
</span>
This code generates the HTML for files that have been linked to the product. Unfortunately, the formatting of that section is pretty ugly by default and I'm trying to figure out how to modify the source. Can't find it to save my soul. It doesn't appear to be anywhere in the template files.
it should be here:
administrator/com_virtuemart\classes\ps_product_files.php
and search for function get_file_list
Right under this function (row 622 - 626) should be html template for product files.
Also hate this non MVC architecture. Looking forward to VM 2.0

Resources