OrdaSoft forum
Welcome, Guest
Please Login or Register.    Lost Password?
try to make a dynamic logo (0 viewing) 

OrdaSoft template Support

Go to bottom Favoured: 0

Try to make a dynamic logo

Jap (User)
Fresh Boarder
Posts: 4
graphgraph
User Offline Click here to see the profile of this user
try to make a dynamic logo 3 Years, 2 Months ago
Karma: 0  
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??
Logged Logged
The administrator has disabled public write access.
Jap (User)
Fresh Boarder
Posts: 4
graphgraph
User Offline Click here to see the profile of this user
Re:try to make a dynamic logo 3 Years, 2 Months ago
Karma: 0  
Ok, my aproach is to easy and it wont work like i wrote in the first topic..

Can some one guide me how to solve this?
Logged Logged
The administrator has disabled public write access.
admin (Admin)
Admin
Posts: 8243
graph
User Online Now Click here to see the profile of this user
Re:try to make a dynamic logo 3 Years, 2 Months ago
Karma: 101  
If you know PHP and Joomla, your path most simply.
Only together with your index.php create it copy with index.php_2021_02_08
so you not anytime - not lost it

So you not lost your changes

For users who not know PHP, we have Joomla Membership Software
With it we for our components, for content from user, in some position show "user profile" - with user image and contact info.

So If under one Login - work many users - this may use as "Company logo".

Regards
OrdaSoft team
Logged Logged
The administrator has disabled public write access.
Jap (User)
Fresh Boarder
Posts: 4
graphgraph
User Offline Click here to see the profile of this user
Re:try to make a dynamic logo 3 Years, 2 Months ago
Karma: 0  
I know a bit of php and joomla. the code i posted here is working in fabrikar and in other Joomla places. Also in pdf templates which have dynamic logo's now depending on the company id.

But, If i try to implement this query into the index file... i get a page not found error.

Thats why I ask if you can guide me in the right direction... about what i am doing wrong.

For now i think i do not need a payed membership... because i have to rebuild some parts of a big existing website.

So I really hope, you can give me an advice... so i can get this to work.

regards

Jap
Logged Logged
The administrator has disabled public write access.
admin (Admin)
Admin
Posts: 8243
graph
User Online Now Click here to see the profile of this user
Re:try to make a dynamic logo 3 Years, 2 Months ago
Karma: 101  
This mean you have some error in PHP

Please turn in Joomla Global settings:
- admin menu: System->"global configuration""->Server: "Error Reporting" - turn to "Development"
- admin menu: System->"global configuration""-> System -> Debug Settings ->YES

and replace:
Code:

$mydb = FabrikWorker::getDbo();

to
Code:


$mydb = JFactory::getDBO();



Regards
OrdaSoft team
Logged Logged
The administrator has disabled public write access.
Jap (User)
Fresh Boarder
Posts: 4
graphgraph
User Offline Click here to see the profile of this user
Re:try to make a dynamic logo 3 Years, 2 Months ago
Karma: 0  
AH great!! Its working like a charm.. it was changing
Code:

$mydb = FabrikWorker::getDbo();
into
Code:

$mydb = JFactory::getDBO();
that did the trick.

What i do not understand is this part of your reply:

Only together with your index.php create it copy with index.php_2021_02_08

I created the file index.php_2021_02_08 and uploaded it to the public_html/templates/ordasofttemplate-basetemplate folder. You can see it in the attached image.
But its not using that file.

I think i misunderstood your explaination. Can you please tell me what you try to explain to me??

Regards
Logged Logged
The administrator has disabled public write access.
Go to top
»