Welcome, Guest
Username: Password: Remember me

TOPIC: default.php view

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

  • Tomaselli
  • Tomaselli's Avatar
  • Online
  • Elite Member
  • Posts: 293
  • Thank you received: 87
  • Karma: 46
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>
The administrator has disabled public write access.

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

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
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
The administrator has disabled public write access.
Time to create page: 0.118 seconds

Get Started