Hi,
on an existing website what is based on joomla and fabrikar they used the ordasoft base template. This is very good. Now I need to make the logo in the upper left corner dynamic.
This because we work with different companies as user, and if a company is logged in with the bedrijf_id (company-id) we want to load the logo belonging/conected to that id.
After reading on the forum I understood to have a change in the themplate I have to change the index php in '/templates/ordasofttemplate-basetemplate'
Is this correct? and if so, when this template gets an update will the changes be lost? or do i need to create a childtemplate or something?
Then in index.php i find the following:
Code: |
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
<div id="logo">
<a href="<?php echo $this->params->get('logo_link')?>">
<img style="width:<?php echo $this->params->get('logo_width')?>px; height:<?php echo $this->params->get('logo_height')?>px; " src="<?php echo $this->params->get('logo_file')?>" alt="Logo" />
</a>
</div>
</div>
|
Can I just write my query in <? php /?> like
Code: |
<?php
$user = JFactory::getUser();
$userId = (int) $user->get('id');
$mydb = FabrikWorker::getDbo();
$query = $mydb->getQuery(true);
$query
->select("bedr_logo")
->from("egocentralis_bedrijven")
->where("bedrijf_id IN (SELECT bedrijf_id FROM g4e_orakel_personeel WHERE userid = " . $userId . ") OR bedrijf_id IN (SELECT bedrijf_id FROM egocentralis_bedrijven WHERE userid = ". $userId . ")");
$mydb->setQuery($query);
$js = $mydb->loadResult();
$result = json_decode($js);
$path = $result[0]->file;
?>
|
and overwrite
Code: |
src="<?php echo $this->params->get('logo_file')?>" alt="Logo" />
|
with:
Code: |
src="<?php echo $path; ?>" alt="Logo" />
|
Or is this the wrong approach?? And will this be undone with updates or something like that??