I'm used to using Joomla 1.5, and am trying to switch to 2.5.
I have 2 modules in the right position, I expect that there would be 2 boxes (which is what I want), one box for each module. But for some reason it's just adding the second module to the first box.
It's not copying the divs (main_top_box, main_mid_box, main_bottom_box) inside the if statement: <?php if($this->countModules('right')) { ?>, instead it's just putting the <jdoc:include type="modules" name="right"/> commands side by side.
You were able to do this with the code I've used in Joomla 1.5. Have they removed this functionality?
Here's what I see:
Here's what I should see:
Joomla Code:
<?php if($this->countModules('right')) { ?>
<div class="main_top_box">
<div class="main_mid_box">
<div class="main_bottom_box">
<jdoc:include type="modules" name="right"/>
</div>
</div>
</div>
<?php } ?>
Code Output(Source):
<div class="main_top_box">
<div class="main_mid_box">
<div class="main_bottom_box">
<div class="custom" >
<h3>Services</h3>
<ul>
<li>Family Law</li>
<li>Collaborative Law</li>
<li>Real Estate</li>
<li>Wills</li>
<li>Estate Planning</li>
<li>Estates</li>
</ul>
<p> </p>
</div>
<div class="custom" >
<h3>Test</h3>
<p>Testing the Right Box</p>
</div>
</div>
</div>
</div>
Should Be(Source):
<div class="main_top_box">
<div class="main_mid_box">
<div class="main_bottom_box">
<h3>Services</h3>
<ul>
<li>Family Law</li>
<li>Collaborative Law</li>
<li>Real Estate</li>
<li>Wills</li>
<li>Estate Planning</li>
<li>Estates</li>
</ul>
</div>
</div>
</div>
<div class="main_top_box">
<div class="main_mid_box">
<div class="main_bottom_box">
<h3>Test</h3>
<p>Testing the Right Box</p>
</div>
</div>
</div>
You can do this by these to methods
Either Change the order of display the module in the same position in the module manager.
Create separate module position for both the modules and assign them accordingly.
Related
I try to extract all links based on these three conditions:
Must be part of <div data-test="cond1">
Must have a <a href="..." class="cond2">
Must not have a <img src="..." class="cond3">
The result should be "/product/1234".
<div data-test="test1">
<div>
<div data-test="cond1">
Link 1
<div class="test4">
<div class="test5">
<div class="test6">
<div class="test7">
<div class="test8">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div data-test="test2">
<div>
<div data-test="cond1">
Link 2
<div class="test4">
<div class="test5">
<div class="test6">
<div class="test7">
<div class="test8">
<img src="bild.jpg" class="cond3">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
I'm able to extract the links with the following xpath query.
//div[starts-with(#data-test,"cond")]/a[starts-with(#class,"cond")]/#href
(I know the first part is not really neccessary. But better safe than sorry.)
But I'm still struggling with excluding the links containing an descendant img tag and how to add it to the query above.
This should do what you want:
//div[#data-test="cond1" and not(.//img[#class="cond3"])]
/a[#class="cond2"]
/#href
/product/1234
I have two separate divs, one where the images are loaded and the other where the data is displayed.
<div class="banner-slider-image">
<div class="swiper-container">
<div class="swiper-wrapper">
<!-- Slide Item -->
<div class="swiper-slide">
<div class="bg" style="background-image: url(include/assets/images/main-slider/1.jpg);">
</div>
</div>
</div>
</div>
</div>
<div class="banner-slider-content">
<div class="side-text">AVANT</div>
<div class="swiper-container banner-slider">
<div class="swiper-wrapper">
#if(count($listings) > 0)
#foreach($listings as $listing)
<!-- Slide Item -->
<div class="swiper-slide">
<div class="content-outer">
<div class="content-box">
<div class="inner">
<h5>{{$listing->first_name}} {{$listing->last_name}}</h5>
<h1><span>{{$listing->name}}</span> </h1>
<div class="text">{{$listing->property_description}}.</div>
<div class="link-box">View Listing</div>
</div>
</div>
</div>
</div>
#endforeach
#endif
</div>
</div>
</div>
So the first div will also be in a foreach loop, but I dont know how I can combine the two where they show the same related data.
Use 2 foreach loops . It is the easiest and desired solution for you. or you can define two variable and concat the contents using one forloop and then display them later like
#php
$first='';
$second='';
#endphp
#if(count($listings) > 0)
#foreach($listings as $listing)
#php
$first.='first div content';
$second.='second div content';
#endphp
#endforeach
#endif
<div class="banner-slider-image">
<div class="swiper-container">
<div class="swiper-wrapper">
{!!$first!!}
</div>
</div>
</div>
<div class="banner-slider-content">
<div class="side-text">AVANT</div>
<div class="swiper-container banner-slider">
<div class="swiper-wrapper">
{!!$second!!}
</div>
</div>
</div>
<html>
<body>
#section('sidebar')
This is the master sidebar.
#show
<div class="container">
#yield('content')
</div>
</body>
use for yield
This one has me stumped., I'm trying to select the first class = csb-quantity-listbox object of the below using the XPATH //select[#class='csb-quantity-listbox'][1], but instead of selecting the first quantity listbox it's selecting ALL the listboxes on the page with that class (see image below).
What am I doing wrong?
<div class="gwt-product-detail-products-container">
<div class="gwt-product-detail-products-header-column">
</div>
<div id="gwt-product-detail-widget-id-12766" class="gwt-product-detail-widget">
<div class="gwt-product-detail-widget-image-column ui-draggable" title="12766">
<div class="gwt-product-detail-widget-options-column">
</div>
<div class="gwt-product-detail-widget-price-column">
</div>
<div class="gwt-product-detail-widget-quantity-panel">
<select class="csb-quantity-listbox" name="quantity_12766"></select>
</div>
<div class="gwt-bundle-add-to-cart-btn">
</div>
</div>
</div>
<div id="gwt-product-detail-widget-id-10617" class="gwt-product-detail-widget">
<div class="gwt-product-detail-widget-image-column ui-draggable" title="10617">
<div class="gwt-product-detail-widget-options-column">
</div>
<div class="gwt-product-detail-widget-price-column">
</div>
<div class="gwt-product-detail-widget-quantity-panel">
<select class="csb-quantity-listbox" name="quantity_10617"></select>
</div>
<div class="gwt-bundle-add-to-cart-btn">
</div>
</div>
</div>
</div>
Image:
You just need to put brackets around the statement before the [1]
Like so:
(//select[#class='csb-quantity-listbox'])[1]
I want to be able to add as many widgets as i want to a page.
To make it easier to visualize, here is what i want to achieve:
Master Page
Regular Page
In regular page, i want to call blade template panel as many times as i want. Of course, i would like to change sections inside each panel too.
Master Page
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">#yield('title')</h1>
</div>
<!-- /.col-lg-12 -->
</div>
<!-- /.row -->
<div class="row">
<div class="col-lg-8">
#yield('panelsLeft')
</div>
<!-- /.col-lg-8 -->
<div class="col-lg-4">
#yield('panelsRight')
</div>
<!-- /.col-lg-4 -->
</div>
<!-- /.row -->
Panel Partial
<div class="panel panel-default">
<div class="panel-heading">
<i class="fa fa-{{ $panelIcon }} fa-fw"></i> #yield('panelTitle')
<div class="pull-right">
<div class="btn-group">
#yield('panelActions')
</div>
</div>
</div>
<!-- /.panel-heading -->
<div class="panel-body">
#yield('panelBody')
</div>
<!-- /.panel-body -->
</div>
<!-- /.panel -->
Regular Page
I want my regular page to extend master page, include as many panels as needed, and set sections of each of them. How can i achieve this?
I couldn't find an answer to this problem. Here is what i tried but it doesn't work:
#extends('layouts.content')
#section('title')
Dashboard
#stop
#section('panelsLeft')
#include('layouts.partial.panel', ['panelIcon'=>'flag'])
#section('panelTitle')
Current Projects
#stop
#section('panelActions')
<button type="button" class="btn btn-default btn-lg">
<span class="glyphicon glyphicon-star"></span> Create New Project
</button>
#stop
#section('panelBody')
<ul class="project-list">
{{ $projects }}
</ul>
#stop
#include('layouts.partial.panel', ['panelIcon'=>'user'])
#section('panelTitle')
Current Users
#stop
#section('panelActions')
<button type="button" class="btn btn-default btn-lg">
<span class="glyphicon glyphicon-star"></span> Create New User
</button>
#stop
#section('panelBody')
<ul class="user-list">
{{ $users }}
</ul>
#stop
#stop
I am using CI with Twitter Bootstrap for a basic site:
In my main layout view this is how the main content area is setup:
<div class="container-fluid">
<div class="row-fluid">
<div class="span1"></div>
<div class="span8">
<?php echo $this->load->view($subview); ?>
</div>
<div class="span3" id="sidebar">
<?php echo $this->load->view($this->global_data['sidebarview']); ?>
</div>
</div>
</div>
One sidebar view is this:
<div class="container-fluid" id="sidebar-about">
<div class="well sidebar-nav">
<ul class="nav nav-list">
<li class="nav-header"><i class="icon-info-sign"></i> More about us</li>
<li class="active">Who are we?</li>
<li>Why we did it?</li>
<li>What we promise?</li>
<li class="nav-header"><i class="icon-asterisk"></i> Services</li>
<li>Free</li>
<li>Premium</li>
</ul>
</div><!--/.well -->
</div><!--/span-->
Every link in this sidebar i want to update the div with class="span8" from my main layout.
How should i do that? Should i use ajax calls to update the content of the span8 div? or just create more methods in about controller?