Elxis CMS Forum
Support => Elxis 4.x/5.x DEV => Topic started by: speck on April 27, 2013, 07:58:12
-
i finish a template and it seems is not possible to manage the image logo_rss.png in multisite.
how can solve this problem without put the hands to elxis4 code?
is possible to fix this in new version?
-
In case of multisite option is enabled, Elxis use the same file system as the root one. So we can't change an image like that.
How can we check if Elxis multisite option is enable and change the image base
$elxis = eFactory::getElxis();
$imgbase = 'media/images/';
if (defined('ELXIS_MULTISITE')) {
if (ELXIS_MULTISITE > 1) {
$imgbase = 'media/images/site'.ELXIS_MULTISITE.'/';
}
}
if (file_exists(ELXIS_PATH).'/'.$base.'myimage.png') {
echo '<img src="'.$elxis->secureBase().'/'.$base.'.myimage.png" width="200" height="100" alt="my image" />';
}
-
Elxis feeds class does support that but the content component that actually generates the feed doesn't make use of this feature.
You have to make a small modification in component content.
Open file components/com_content/controllers/generic.php
Go to line 150:
$feed->addChannel($channel_title, $channel_link, $elxis->getConfig('METADESC'));
And change it to:
$feed_image = '';
if (defined('ELXIS_MULTISITE')) { if (ELXIS_MULTISITE > 1) { $feed_image = $elxis->secureBase().'/media/images/logo_rss'.ELXIS_MULTISITE.'.png'; } }
$feed->addChannel($channel_title, $channel_link, $elxis->getConfig('METADESC'), $feed_image);
Now, put your images in folder media/images/
The logo for the mother site (id = 1) is the default one: media/images/logo_rss.png
For multisite with id = 2 will be media/images/logo_rss2.png
For multisite with id = 3 will be media/images/logo_rss3.png
etc...
-
thanks datahell and thanks to stravos for your help as forever,
i've already tried the solution of webgift, but nothing, in the meantime i prefer to not modify the elxis code it because in a new template for elxis i developed, there's the possibility to change the logo image for rss too. but trying in multisite i saw not works.
if it was for me, looking the code i've found by myself where to apply the modifies, but the template is not for me but for u want use it, so i prefer the people don't put the hand to elxis code. i'll put an advice that under multisite is not possilble to have different logo for rss, also beacuse beeing a commercial template i bet will be very difficult the people will use the template under multisite with different logo for rss.
if is possible, maybe will be nice to apply this modify in new elxis.
-
If you dont want to modify the Elxis core then do it via htaccess.
It is easy. Put re-write rules like the ones shown below exactly after "RewriteBase /" in your htaccess file.
RewriteRule ^xxxxx/media/images/logo_rss.png /media/images/logo2.png [L,R=301,NC]
RewriteRule ^yyyyy/media/images/logo_rss.png /media/images/logo3.png [L,R=301,NC]
etc...
Where xxxxx the base name for the 2nd multi-site, yyyyy the base name for the 3rd multi-site, etc...
-
woowwww
thanks a lot... great help.
i'm debit of another bier with u ;D
-
Beer accepted, hic! :D