Jump to content
  • 0

In which File would I find....


Question

Posted

I'm messing around with my client area a little, I can find most of the elements, but I can find which file to edit to change the way Client#1500 and the menu looks (just on the client dashboard)

Still getting to grips with the way blesta is structured so thanks for the help :)

Untitled.png

17 answers to this question

Recommended Posts

  • 0
Posted

Hi mate,

depends on what you want to do? you can change the text in the theme structure.pdt look for:

<?php if( $page_title != '' ){echo $page_title;}else{echo ($this->Html->ifSet($title) ? $this->Html->_($title, true) : $this->_("AppController.client_structure.default_title", true));}?>

or

<?php echo $this->Html->ifSet($title) ? $this->Html->_($title, true) : $this->_("AppController.client_structure.default_title", true));?>

 

  • 0
Posted

first thing I wanted to do was to replace the massive CLIENT#1500 with something like "welcome back Stu" and put it left align, pretty much how you have it on your site.

then i just wanted to see how the menu was called to the page.

  • 0
Posted
1 hour ago, Stu said:

first thing I wanted to do was to replace the massive CLIENT#1500 with something like "welcome back Stu" and put it left align, pretty much how you have it on your site.

then i just wanted to see how the menu was called to the page.

The bottom nav is Blesta's navigator which is pre-filled with plugin menus, etc you can add to it by finding it in the structure.pdt it should be something like:

<div class="nav-content">
			<div class="nav">
				<nav class="navbar navbar-default" role="navigation">
					<div class="navbar-header">
						<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
							<span class="sr-only"><?php $this->_("AppController.sreader.navigation");?></span>
							<span class="icon-bar"></span>
							<span class="icon-bar"></span>
							<span class="icon-bar"></span>
						</button>
					</div>

					<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
						<div class="container">
							<?php
							$active_nav = null;
							?>
							<ul class="nav navbar-nav">
								<?php
								foreach ($this->Html->ifSet($nav, array()) as $link => $value) {
									$attributes = array();
									$link_attributes = array();
									$dropdown = !empty($value['sub']);
									$active = false;

									if ($value['active']) {
										$active = true;
										$attributes['class'][] = "active";
										$active_nav = $value;
									}
									if ($dropdown) {
										$attributes['class'][] = "dropdown";
										$link_attributes['class'][] = "dropdown-toggle";
										$link_attributes['data-toggle'][] = "dropdown";

										// Set parent to active if child is
										if (!$active) {
											foreach ($this->Html->ifSet($value['sub'], array()) as $sub_link => $sub_value) {
												if ($sub_value['active']) {
													$attributes['class'][] = "active";
													break;
												}
											}
										}
									}
								?>
								<li<?php echo $this->Html->buildAttributes($attributes);?>>
									<a href="<?php $this->Html->_($link);?>"<?php echo $this->Html->buildAttributes($link_attributes);?>>
										<i class="<?php $this->Html->_($value['icon']);?>"></i>
										<?php
										$this->Html->_($value['name']);

										if ($dropdown) {
										?>
										<b class="caret"></b>
										<?php
										}
										?>
									</a>
									<?php
									if (!empty($value['sub'])) {
									?>
									<ul class="dropdown-menu">
										<?php
										foreach ($this->Html->ifSet($value['sub'], array()) as $sub_link => $sub_value) {
										?>
										<li>
											<a href="<?php $this->Html->_($sub_link);?>"><i class="<?php $this->Html->_($sub_value['icon']);?>"></i> <?php $this->Html->_($sub_value['name']);?></a>
										</li>
										<?php
										}
										?>
									</ul>
									<?php
									}
									?>
								</li>
								<?php
								}
								?>
							</ul>

							<ul class="nav navbar-nav navbar-right">
								<li class="dropdown">
									<a href="#" class="dropdown-toggle" data-toggle="dropdown">
										<?php $this->Html->_($client->first_name);?> <?php $this->Html->_($client->last_name);?>
										<b class="caret"></b>
									</a>
									<ul class="dropdown-menu">
										<li><a href="<?php echo $this->Html->safe($this->client_uri . "main/edit/");?>"><i class="fa fa-edit fa-fw"></i> <?php $this->_("AppController.client_structure.text_update_account");?></a></li>
										<?php
										if ($this->Html->ifSet($portal_installed, false)) {
										?>
										<li><a href="<?php echo $this->Html->safe(WEBDIR);?>"><i class="fa fa-circle-o fa-fw"></i> <?php $this->_("AppController.client_structure.text_return_to_portal");?></a></li>
										<?php
										}
										?>
										<li class="divider"></li>
										<li><a href="<?php echo $this->Html->safe($this->client_uri . "logout/");?>"><i class="fa fa-sign-out fa-fw"></i> <?php $this->_("AppController.client_structure.text_logout");?></a></li>
									</ul>
								</li>
							</ul>
						</div>
					</div><!-- /#header .navbar-collapse -->
				</nav>
			</div>
		</div>
		<?php
			}
		}
		?>

and you can add new links there in after this bit:

</ul>
									<?php
									}
									?>
								</li>

Where you can add <li>Yourlink or stuff here</li>

------

As for the welcome back we have a tutorial here: Welcome the client or Welcome them back.

  • 0
Posted

ok thanks, I was looking in

/app/controllers/client.main.php

 

                $this->contact = $this->Contacts->getByUserId($this->Session->read("blesta_id"), $this->client->id);
                if (!$this->contact)
                        $this->contact = $this->Contacts->get($this->client->contact_id);

 

I guess I was way off lol.

Thanks for the help, I'll look through it and figure it out :)

 

 

EDIT: just realised you're talking about the navigation lol

  • 0
Posted
33 minutes ago, Stu said:

ok thanks, I was looking in

/app/controllers/client.main.php

 

                $this->contact = $this->Contacts->getByUserId($this->Session->read("blesta_id"), $this->client->id);
                if (!$this->contact)
                        $this->contact = $this->Contacts->get($this->client->contact_id);

 

I guess I was way off lol.

Thanks for the help, I'll look through it and figure it out :)

 

 

EDIT: just realised you're talking about the navigation lol

Ah did you mean something else mate lol?

  • 0
Posted

Sorry I'm not explaining myself properly lol

The current default look is like this...

client.png.60350335010e2dbbd3aab9d11ba39a07.png

 

I dont see the need to show the client their client_id, I much prefer the traditional look of "welcome back stu" like you have on licensecart....

58c9e2949da63_welcomeback.png.32f77da2ffd5e8abb8c3acc088c21fa4.png

 

So I was expecting to see in a file somewhere 'client_id' and be able to change it for  'first_name'

very much what you pointed me in the direction of here...

https://licensecart.com/plugin/support_manager/knowledgebase/view/482/welcome-the-client-or-welcome-them-back/12/

So all I need to do is figure out which file controls the layout of the client dashboard now. Is that /app/controllers/client.main.pdt ?

or should I be looking in structure.pdt?

 

 

  • 0
Posted
54 minutes ago, Stu said:

Sorry I'm not explaining myself properly lol

The current default look is like this...

client.png.60350335010e2dbbd3aab9d11ba39a07.png

 

I dont see the need to show the client their client_id, I much prefer the traditional look of "welcome back stu" like you have on licensecart....

58c9e2949da63_welcomeback.png.32f77da2ffd5e8abb8c3acc088c21fa4.png

 

So I was expecting to see in a file somewhere 'client_id' and be able to change it for  'first_name'

very much what you pointed me in the direction of here...

https://licensecart.com/plugin/support_manager/knowledgebase/view/482/welcome-the-client-or-welcome-them-back/12/

So all I need to do is figure out which file controls the layout of the client dashboard now. Is that /app/controllers/client.main.pdt ?

or should I be looking in structure.pdt?

 

 

All the themes stuff are in structure.pdt, this is mine:

<h1 class="headercrumb">
                <?php
                // $this->Html->ifSet($logged_in)
                if (strpos($_SERVER['REQUEST_URI'], "customers")  && $page_title != "Our Customers" || strpos($_SERVER['REQUEST_URI'], "order") !== false){
                  $today_date = date('Y-m-d H:i:s');
                  if($client->date_added == $today_date){
                    echo "Welcome ";
                    echo $client->first_name;
                    echo "...";
                  }else{
                    echo "Welcome back ";
                    echo $client->first_name;
                    echo "!";
                  }
                }elseif (strpos($_SERVER['REQUEST_URI'], "category") == true){
                    echo "Categories";
                  }elseif( $page_title != '' ){
                    echo $page_title;
                  }else{
                    echo ($this->Html->ifSet($title) ? $this->Html->_($title, true) : $this->_("AppController.client_structure.default_title", true));
                  }
                ?>
            </h1>

 

  • 0
Posted
On 3/15/2017 at 8:47 PM, Licensecart said:

All the themes stuff are in structure.pdt, this is mine:


<h1 class="headercrumb">
                <?php
                // $this->Html->ifSet($logged_in)
                if (strpos($_SERVER['REQUEST_URI'], "customers")  && $page_title != "Our Customers" || strpos($_SERVER['REQUEST_URI'], "order") !== false){
                  $today_date = date('Y-m-d H:i:s');
                  if($client->date_added == $today_date){
                    echo "Welcome ";
                    echo $client->first_name;
                    echo "...";
                  }else{
                    echo "Welcome back ";
                    echo $client->first_name;
                    echo "!";
                  }
                }elseif (strpos($_SERVER['REQUEST_URI'], "category") == true){
                    echo "Categories";
                  }elseif( $page_title != '' ){
                    echo $page_title;
                  }else{
                    echo ($this->Html->ifSet($title) ? $this->Html->_($title, true) : $this->_("AppController.client_structure.default_title", true));
                  }
                ?>
            </h1>

 

Hello Michael

Does this work in v4, tried to copy the code off your page but believe it is protected.

https://licensecart.com/plugin/support_manager/knowledgebase/view/482/welcome-the-client-or-welcome-them-back/12/

If it works where exactly in structure.pdt do I put it, what section of the file.

Thank you

  • 0
Posted
17 minutes ago, mlsto said:

Hello Michael

Does this work in v4, tried to copy the code off your page but believe it is protected.

https://licensecart.com/plugin/support_manager/knowledgebase/view/482/welcome-the-client-or-welcome-them-back/12/

If it works where exactly in structure.pdt do I put it, what section of the file.

Thank you

It does work on v4 mate :) sorry about that article is for our cms customers haha :P

Search for: 

$this->Html->ifSet($title) ? $this->Html->_($title, true) : $this->_("AppController.client_structure.default_title", true)
  • 0
Posted

Thanks Michael

And the code I would use is the following or I need the full code you have with the h1 class header crumb or just this:

<?php
                // $this->Html->ifSet($logged_in)
                if (strpos($_SERVER['REQUEST_URI'], "customers")  && $page_title != "Our Customers" || strpos($_SERVER['REQUEST_URI'], "order") !== false){
                  $today_date = date('Y-m-d H:i:s');
                  if($client->date_added == $today_date){
                    echo "Welcome ";
                    echo $client->first_name;
                    echo "...";
                  }else{
                    echo "Welcome back ";
                    echo $client->first_name;
                    echo "!";
                  }
                }elseif (strpos($_SERVER['REQUEST_URI'], "category") == true){
                    echo "Categories";
                  }elseif( $page_title != '' ){
                    echo $page_title;
                  }else{
                    echo ($this->Html->ifSet($title) ? $this->Html->_($title, true) : $this->_("AppController.client_structure.default_title", true));
                  }
                ?>
  • 0
Posted
57 minutes ago, mlsto said:

Sorry tried your code but does not work for me, either getting the code showing or just the client number showing, it does not show as Welcome Client Name.

Try this mate:

<?php
                if (strpos($_SERVER['REQUEST_URI'], "client") || strpos($_SERVER['REQUEST_URI'], "order") !== false){
                  $today_date = date('Y-m-d H:i:s');
                  if($client->date_added == $today_date){
                    echo "Welcome ";
                    echo $client->first_name;
                    echo "...";
                  }else{
                    echo "Welcome back ";
                    echo $client->first_name;
                    echo "!";
                  }
                }else{
                    echo ($this->Html->ifSet($title) ? $this->Html->_($title, true) : $this->_("AppController.client_structure.default_title", true));
                  }
                ?>

remember you are replacing:

<?php echo ($this->Html->ifSet($title) ? $this->Html->_($title, true) : $this->_("AppController.client_structure.default_title", true));?>

 

  • 0
Posted
1 hour ago, Licensecart said:

Try this mate:


<?php
                if (strpos($_SERVER['REQUEST_URI'], "client") || strpos($_SERVER['REQUEST_URI'], "order") !== false){
                  $today_date = date('Y-m-d H:i:s');
                  if($client->date_added == $today_date){
                    echo "Welcome ";
                    echo $client->first_name;
                    echo "...";
                  }else{
                    echo "Welcome back ";
                    echo $client->first_name;
                    echo "!";
                  }
                }else{
                    echo ($this->Html->ifSet($title) ? $this->Html->_($title, true) : $this->_("AppController.client_structure.default_title", true));
                  }
                ?>

remember you are replacing:


<?php echo ($this->Html->ifSet($title) ? $this->Html->_($title, true) : $this->_("AppController.client_structure.default_title", true));?>

Worked perfectly, thank you very much Michael.

Thank you so much Michael, worked perfectly, not in the header but not a problem at all, no complaints, you are the best.

Much appreciation.

Thanks again

  • 0
Posted
1 hour ago, mlsto said:

Michael can this be shown only in the client account and not everywhere?

Thank you

I tried but failed if you can find a way around this with:

<?php if ($this->Html->ifSet($logged_in)) { ?>

<?php } ?>

 

  • 0
Posted
4 hours ago, Licensecart said:

I tried but failed if you can find a way around this with:


<?php if ($this->Html->ifSet($logged_in)) { ?>

<?php } ?>

 

Wow you are asking me to code, sorry wrong person for this.

Thanks anyway.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...