Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

default.php view 30 Nov 2013 17:50 #11716

a little cleaning tip:

the following code is just an example.

JCOOK generated code:
	<?php if ($compat == '3.0'): ?>
	<div class="row-fluid">
		<div id="contents" class="span12">
			<div>

				<!-- BRICK : multilanguage -->
				<?php echo $this->loadTemplate('multilanguage'); ?>
			</div>
			<div>

				<!-- BRICK : options -->
				<?php echo $this->loadTemplate('options'); ?>
			</div>
			<div>

				<!-- BRICK : events -->
				<?php echo $this->loadTemplate('events'); ?>
			</div>
		</div>
	</div>
	<?php elseif ($compat == '1.6'): ?>
	<div>
		<div>

			<!-- BRICK : multilanguage -->
			<?php echo $this->loadTemplate('multilanguage'); ?>
		</div>
		<div>

			<!-- BRICK : options -->
			<?php echo $this->loadTemplate('options'); ?>
		</div>
		<div>

			<!-- BRICK : events -->
			<?php echo $this->loadTemplate('events'); ?>
		</div>
	</div>
	<?php endif; ?>


I would write it:
	<?php if ($compat == '3.0'): ?>
	<div class="row-fluid">
		<div id="contents" class="span12">		
	<?php elseif ($compat == '1.6'): ?>
	<div>
		<div>		
	<?php endif; ?>
			<div>

				<!-- BRICK : multilanguage -->
				<?php echo $this->loadTemplate('multilanguage'); ?>
			</div>
			<div>

				<!-- BRICK : options -->
				<?php echo $this->loadTemplate('options'); ?>
			</div>
			<div>

				<!-- BRICK : events -->
				<?php echo $this->loadTemplate('events'); ?>
			</div>
		</div>
	</div>

Please Log in or Create an account to join the conversation.

default.php view 30 Nov 2013 18:40 #11717

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
Yeah, thanks, I am gonna rewrite all this soon.
Making it easier.

I was trying to follow Joomla standards from all version crossed along the way, but at the end I think I am gonna suppress the left menu defnitivly, because it is a pain.

It has been introduced since J!3.0, but seems already past over (If I understood well, since 3.2)
Make it easier for all versions a plain page rendering the same in back and front.

Only the toolbar will be the particular case.
The menu should be abstracted (as Cook does), and displayable as wishes in a defined areas, even handle multiple menus, different renderings, etc...
Being automatic is super cool, but this should be handled by the component (not by default)
So, the component can generate automaticaly the same, but in a better way so it is not a pain for cross-versions components.

Then the filters part will be placed at the top with a nice automated rendering.
Coding is now a piece of cake

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.053 seconds

  Joomla Developpers won't be able to live without J-Cook's Component Creator! Check it out - it'll save you a heap of time coding so you can concentrate on the creative part of developing!
Mind-Your-Biz-Online

Get Started