How to hide menu bar code for login page in phalcon - phalcon

Hi I am developing a website using phalcon. My homepage is divided into header index and footer. The header has a menu bar which is common to all other pages but for the login page I don't want this menu bar. How to hide this menu bar code only in the login page? Please help me.
My menu bar code is
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav main_menu">
<li><?php echo Phalcon\Tag::linkTo(array('index', '<img src="images/home.png">'));?></li>
<li><?php echo Phalcon\Tag::linkTo(array('my-sale', '<img src="images/mysale.png">'));?></li>
<li><?php echo Phalcon\Tag::linkTo(array('customers', '<img src="images/customers.png">'));?></li>
<li><?php echo Phalcon\Tag::linkTo(array('campaign', '<img src="images/campaign.png">'));?></li>
<li><?php echo Phalcon\Tag::linkTo(array('analysis', '<img src="images/analysis.png">'));?></li>
<li><?php echo Phalcon\Tag::linkTo(array('myaccount', '<img src="images/myaccount.png">'));?></li>
</ul>
</div>
How to hide this menu bar code in my login page?
Please help.

if you use Hierarchical Rendering with two main layout then in login action you can switch to login layout like this:
public function loginAction(){
$this->view->setMainView('login');
}

Related

Why radio buttons doesn't remain unchangeable and checked?

I'm new here and I'm writing my first php code. I want to prepare a multiple choice quiz in which, after click on a button at the end of the page, the radios button (the choices of the test) will remain checked and unchangeable. I simplify the code in this way:
<?php
$choice1 = "a";
$choice2 = "b";
?>
<form method="post" name="testForm" id="testForm">
<ul>
<li><input type="radio" name="q1" value="a"
<?php if(isset($_POST['test-result']) && $radioVal==$choice1){ echo "disabled='disabled' checked";}?>
<?php if(isset($_POST['test-result']) && $radioVal<>$choice1){ echo "disabled='disabled'";}?>>
<?php echo "<span id='question'>". $choice1 ."</span>";?> </li>
<li><input type="radio" name="q1" value="b"
<?php if(isset($_POST['test-result']) && $radioVal==$choice2){ echo "disabled='disabled' checked";}?>
<?php if(isset($_POST['test-result']) && $radioVal<>$choice2){ echo "disabled='disabled'";}?>>
<?php echo "<span id='question'>". $choice2 ."</span>";?> </li>
</ul><br>
<button class='button' name='test-result'>Finaliza el test</button>
</form>
<?php
if (isset($_POST['test-result']))
{
$radioVal = $_POST["q1"];
}
?>
However, after click on the button, all radios remain uncheged (and this is ok) but the choices made are not checked. Can someone help me? Thanks in advance!
Checkbox is not showing checked because variable $radioVal is set after input box. To resolve your issue could you please set $radioVal before from.

Add opacity to jssor slider nearby visible images

I want to add opacity to the nearby images of a jssor slider.
I found this old one but I cannot get it to work:
jssor nearby slider opacity upcoming photos
especially this part:
<div data-u="slides" id="slideimage-content">
<?php foreach ($sectionImage as $key => $value) {?>
<div data-p="112.50" style="display: none;border-style:none; ">
<img data-u="image" src="<?php echo $value['url'] ?>" style="border-style:none;"/>
<div class="slidecover slidecover<?php echo $key ?> coverdark"></div>
</div>
<?php } ?>
</div>
Jfiddle
https://jsfiddle.net/sLjfu7xc/3/
Thanks
For now, you can add static cover above to make it appear like that.
Download jssor slider dev pack, find the demo ‘examples/overlay-cover.html’.
Btw, we will implement this as built feature later.

Colorbox does not group images

I'm using Colorbox in form of Yii 1.x widget. Everything works fine, except for the fact, that Colorbox does not group my images and does not show <-- / --> buttons.
This is part of code generated by my page:
<div class="media-gallery-wrapper">
<div class="media-gallery-item">
<a href="http://127.0.0.1/usrector/htdocs/uploads/galleries/15.jpg" class="colorbox cboxElement" title="">
<img src="http://127.0.0.1/usrector/htdocs/uploads/galleries/15small.jpg" alt="" width="450" height="450">
</a>
</div>
</div>
Each three of such blocks are followed by:
<div class="media-gallery-separator"></div>
And that's all. Even though I've been trying to modify my code and browsing through Colorbox examples, I don't see any significant difference between my code and those on examples. Thus, I don't know, what makes my Colorbox not grouping images?
Grouping in Colorbox works only, if you base it on rel attribute. You can't use classes.
So, this:
<a href="<?php echo $filename; ?>" class="colorbox" title="<?php echo $title; ?>">
<script type="text/javascript">
jQuery('.colorbox').colorbox({'maxHeight':'80%','maxWidth':'90%'});
</script>
won't work (no image grouping, no <- / -> buttons), while this:
<a href="<?php echo $filename; ?>" rel="colorbox" title="<?php echo $title; ?>">
<script type="text/javascript">
jQuery('a[rel="colorbox"]').colorbox({'maxHeight':'80%','maxWidth':'90%'});
</script>
will work like a charm.

How to add a dynamic widget area title

I need some help with an issue.
I have a widget area on my home page with 4 widgets in it.
Each widget has a title, an image and a description.
I want to know how can I add a dynamic title for the whole area, above all the 4 widgets.
The title should be changed by the user in the backend of the widget area.
Here is my code:
<div class="row-fluid">
<h1>The dynamic title should be here</h1>
<?php
if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('utility-area') ) : ?><?php endif;
?>
</div>
I hope it all make sense and thank you very much!
<div class="row-fluid">
<h1><?php echo($someDynamicTitleYouveGotFromYourDatabaseOrWhatever); ?></h1>
<?php
if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('utility-area') ) : ?><?php endif;
?>
</div>

image link in Yii framework

hello friends I am newbie to YII. I have an image . After calling that image in Yii its code like is this
<img class="deals_product_image" src="<?php echo MPFunctions::uploaded_image_url($data->item_display_image()->file_ufilename); ?>" alt="<?php echo $data->name; ?>" />
in general html it is doing like this
<img alt="women jackets" src="files/items/images/4db3b3b6a7c06/womens-jacket-thumb.jpg" class="deals_product_image">
Now I want that this image should be a href link like
<a href="files/items/images/4db3b3b6a7c06/womens-jacket-thumb.jpg img src="files/items/images/4db3b3b6a7c06/womens-jacket-thumb.jpg class="deals_product_image"/> </a>
so for this I used code like this
<?php echo CHtml::link('', array('items/viewslug', 'slug'=>$data->slug)); ?>
But it is not showing any link tag like <a href="">
so can any one tell me what should I do?What should I write in between '' tags?
You should simply give the html for the <img> tag as the first parameter:
$imageUrl = MPFunctions::uploaded_image_url($data->item_display_image()->file_ufilename);
$image = '<img class="deals_product_image" src="'.$imageUrl.'" alt="'.$data->name.'" />';
echo CHtml::link($image, array('items/viewslug', 'slug'=>$data->slug));
By the way, you can use CHtml::image to create the <img> tag as well:
$imageUrl = MPFunctions::uploaded_image_url($data->item_display_image()->file_ufilename);
$image = CHtml::image($imageUrl, $data->name, array('class' => 'deals_product_image'));
echo CHtml::link($image, array('items/viewslug', 'slug'=>$data->slug));