7
votes
Joomla constant to current template path
Look at https://gist.github.com/leFlea-snippets/4602845
PHP: Joomla - Get active template path
// Get active template path from anywhere on Joomla:
$app = JFactory::getApplication();
$path = ...
6
votes
Accepted
Can Joomla be used as a photo gallery for large amounts of images?
When you choose a CMS, you are usually best picking the one which has the most features you need out-of-the-box. The rest you will have to build for yourself (unless an extension does exactly what ...
4
votes
Ajax error when attempting component updates
I recently encountered this XMLHttpRequest error myself. The root of the problem caused 3 different issues.
SOLUTION: In my case, the problem was caused by an incorrect setting for the public $...
4
votes
Random image in an article
You have to use a more specific CSS selector in order to target only the main image, and not all images added to an article.
The main article image (added through the "Images and links" tab in the ...
4
votes
Accepted
Can't insert intro/full article image
You have either some files corrupted on update, or some outdated server software.
Overwrite your web-site with Joomla 3.6.0 full package to be sure it's no a file corruption (extract the Joomla full ...
4
votes
Edit multiple images at once
An alternative way to do this is to apply the margins via a suitable CSS selector in a custom CSS file.
You can limit the styling to a single page if you want by using a page class and including this ...
4
votes
Accepted
get intro-image from article?
When developing, error reporting should be enabled. You'll see this:
Notice: Undefined property: Joomla\CMS\Table\Content::$item
Access the images like this:
$images = $article->images;
3
votes
Accepted
How to prevent Article images width being stretched to 100%
Normally you won't find good answers that are specific to the template you use. All templates are different.
I visited your page and in your case you have this in your template CSS (line 3891 in http:...
3
votes
Add html to Article Image captions
The issue with the answer given in that other question is that it requires edits to Joomla core files so site updates eventually will undo your changes. That'll create a maintenance issue for you (ie, ...
3
votes
Define a default intro image on article submissions
You would want to put this as a template override for com_content. Depending on whether you want it to appear on the category page or single article, the file would go
/templates/TEMPLATE_NAME/html/...
3
votes
Accepted
Latest articles structured data markup
I would have preferred to just suggest some touch ups to your snippet, but there is too much for me to address in your answer as a comment and I'd rather explain fully. Instead, I'll post this new ...
2
votes
Force users to upload images with a given ratio
You can maybe "cosider" some users dont have the image In this ratio.
You can use JCE editor with plugin image manager extended to possibility user crop his image in this ratio.
https://www....
2
votes
How to use images from the domain images folder for all subdomains?
If your sites are on Apache web server, you can share images folder from one site to the other, by creating symbolic links. With this technique I successfully created common images folder, which is ...
2
votes
Accepted
Enable 'Title' attribute for images with TinyMCE Editor
The current version of TinyMCE (v4.4.3) now seems to have this option enabled (see below).
2
votes
Accepted
Edit multiple images at once
Sure there is an easier way of doing what you need, and also any other batch change in article...
I've been doing it for ages...
But for that you have to use editor more suitable for programmers than ...
2
votes
Accepted
Random image in an article
This might not be the exact answer you are looking for, but if it is for a full website you are developing and not only for a template that you want to distribute, then the following ideas could work ...
2
votes
Get Category intro image in the index.php
Knowing a tiny bit about the joomla request-reponse lifecycle will help here. Joomla runs in the following order:
1. bootstrap the application
2. router
3. component (including your own layout ...
2
votes
Images appear in backend but not in frontend
Two possibilities I can think of:
Installing the extension has changed the base tag. View the source and make sure this is still pointing to the site root, so that relative links to images/ are ...
2
votes
Ajax error when attempting component updates
Update
I had the issue again today, renaming the htaccess only without disabling Admin Tools and then updating worked for me. So it seems to have to do with the rules, set in the htaccess by Admin ...
2
votes
Why is there no way to show intro image in single article page?
I don't agree. I never use the same image as intro- and full-text image. If you want to do that, it's very simple to copy/paste from intro- to full-text image, when have picked the into.
And if you ...
2
votes
Accepted
Additional "Images And Links" fields - corect way
I would suggest using Joomla custom fields instead. The media field should work: https://docs.joomla.org/J3.x:Adding_custom_fields/Media_Field
2
votes
Accepted
Programmatically set article image
I don't see set() in the JTable docs. You also need to remember to re-encode the full column value before storing. The following is an untested snippet.
$db = JFactory::getDbo();
$query = $db->...
2
votes
Accepted
Mod_Feed removing the strip image function what do the True & False do?
The arguments for JHtmlString::truncate() are:
string $text The text to truncate.
integer $length The maximum length of the text.
boolean $noSplit Don't split a word if that is where ...
2
votes
Photo size validation
I think I have a good idea where the error is. You are using $this->getFileName() to get the files original name, then you mutate the filename using normalize(). At this point you have a new file ...
2
votes
Accepted
How can I add height and width attributes to an image in a menu?
Your attributes are added only when image class is set. If you want dimensions on all images, move the code outside of $item->menu_image_css check:
if ($item->menu_image)
{
$image_attributes[...
2
votes
Accepted
Is there a way to use an SVG image in Cassiopeia
I don't know if you figure it out yet. Hopefully you did, But just in case for other to want the answer. In Joomla 4 you have tod, in the media manager add "svg" to supported file extensions ...
2
votes
override for /layouts/joomla/content/full_image.php // alt attributes for images in Joomla 4
I found a way to solve it:
if(empty($images->image_fulltext_alt) && empty($images->image_fulltext_alt_empty))
{
$alt = $item->title;
}
else
{
$alt = $images->image_fulltext_alt;
}
...
2
votes
Add intro or full image to a component/module Joomla 4
You can get the equivalent of what you had in Joomla 3 by going into System / Templates then clicking on Cassiopeia (or whatever site template you're using) Details and Files, and then creating a ...
2
votes
Add title to image tag
It's not clear what the screenshot is supposed to show and what is the context. Where do you add those images?
When editing a Joomla article, you can add images through the Images tab, and there you ...
1
vote
Get Category intro image in the index.php
Firstly, the only code that should go into index.php is code that should appear on every page. What you want to do is on the category view, so your code should go in the category view override.
It is ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
images × 79joomla-3.x × 34
articles × 17
php × 7
templates × 6
joomla-4.x × 6
file-upload × 6
template-override × 5
module × 4
css × 4
virtuemart × 4
overrides × 3
k2 × 3
ajax × 3
layout × 3
search × 3
media-manager × 3
joomla-2.5 × 2
development × 2
joomla-3.4 × 2
extensions × 2
joomla-api × 2
database × 2
custom-field × 2
installation × 2