Creating a Book type Product Catalog Tutorial

More
13 years 1 month ago - 12 years 10 months ago #14778 by jwwicks
Hello All,

I'm creating a series of tutorials for creating a book catalog in FlexiContent.

Here's Part One - jwwicks.com/blog/item/creating-a-book-ca...lexicontent-cck.html

Here's Part Two - jwwicks.com/blog/item/part-2-creating-a-...lexicontent-cck.html

I'll add Part Three later this weekend.

Hope this helps someone...

Jw
Last edit: 12 years 10 months ago by jwwicks.

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

More
13 years 1 month ago #14779 by kenmcd

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

More
13 years 1 month ago - 12 years 10 months ago #14782 by jwwicks
Here's Part III - jwwicks.com/blog/item/part-3-creating-a-...lexicontent-cck.html

And next I'll add some custom PHP code to the template, change the zones and change the CSS so the catalog looks like this - www.smbbooks.com/browse-smb-books.html
Last edit: 12 years 10 months ago by jwwicks.

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

More
13 years 1 month ago #14784 by kenmcd
.
How did you modify the alpha-index to lump the numbers into the "#" sign.
I, and I am sure a number of other users, would like to have that template modification.

Awhile back I modified the alpha-index to get the characters list from the language file instead of being hard-coded into the template.

Perhaps I can combine these two modifications for a better alpha-index.
But that still leaves the lack of an SEF link for the letters.
<sigh>


Part 3 looks great.
Very helpful.
.

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

More
13 years 1 month ago #14797 by micker
thanks fot this tutoriels !!!!
can we moved on tips forum ? for more visibility ?

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

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

More
13 years 1 month ago #14805 by jwwicks

kenmcd wrote: .
How did you modify the alpha-index to lump the numbers into the "#" sign.
I, and I am sure a number of other users, would like to have that template modification.


Here's what I have for the code in category_alpha.php...
Code:
<?php /** * @version 1.5 beta 5 $Id: blog_alpha.php 85 2009-10-10 13:48:04Z vistamedia $ * @package Joomla * @subpackage FLEXIcontent * @copyright (C) 2009 Emmanuel Danan - www.vistamedia.fr * @license GNU/GPL v2 * * FLEXIcontent is a derivative work of the excellent QuickFAQ component * @copyright (C) 2008 Christoph Lukes * see www.schlu.net for more information * * FLEXIcontent is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ defined( '_JEXEC' ) or die( 'Restricted access' ); ?> <div class="alpha-wrapper"> <ul id="alpha-index-<?php echo $this->category->id; ?>" class="alpha-index"> <li class="alpha-first"><h3>Alphabetic Index</h3></li> <li class="alpha-letter"><a id="letter-all" href="#" onclick="document.getElementById('alpha_index').value='';document.getElementById('adminForm').submit();"><span>*</span></li> <?php $letters = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'); foreach ($letters as $letter) : if (in_array($letter, $this->alpha)) : echo "<li class=\"alpha-letter enabled\"><a id=\"letter-".$letter."\" href=\"#\" onclick=\"document.getElementById('alpha_index').value='".$letter."';document.getElementById('adminForm').submit();\"><span>".strtoupper($letter)."</span></li>"; else : echo "<li class=\"alpha-letter disabled\"><span>".strtoupper($letter)."</span></li>"; endif; endforeach; ?> <li class="alpha-last"><span>0-9</span></li> </ul> </div>

And the category.css...
Code:
/* * alpha-index */ div.alpha-wrapper{ float: left; height:42px; width: 100%; margin: 0; clear: both; overflow: hidden; background: url('../images/alpha-index.png') top center no-repeat;} ul.alpha-index { height: 30px; list-style-type: none; top: 0; margin: 0 auto; width: 60%; overflow: hidden; } .alpha-index li.alpha-first{ position: absolute; height: 30px; width: 15px; left: 0; margin-left: -15px; padding-left: 0; } .alpha-index li.alpha-first+li{ border-left: 1px solid #fff; } .alpha-index li.alpha-first h3{ display: none; } .alpha-index li { display: inline-block; line-height: 30px; margin: 0; padding: 0px 5px 0px 5px; border-right: 1px solid #fff; } .alpha-index li a span{ display: inline-block; line-height: 30px; } .alpha-index a:link, .alpha-index a:visited, .alpha-index li a#letter-all { color: #FFF; text-decoration: none; } li.alpha-letter:hover{ background-color: #71899d; } .alpha-index a:hover { color: #FFF; text-decoration: none; background-color: #71899d; } .alpha-index a:active{ } .alpha-index span { cursor: pointer; } .alpha-index li.alpha-last{ position: absolute; height: 30px; width: 20px; top: 0; right: 0; margin-right: -20px; } .alpha-index li.alpha-last span{ display: none; } .alpha-index li.disabled{ color: #0e2b44; } .alpha-index li.disabled:hover{ background-color: transparent; }

Basically it's the document.getElementById('alpha_index').value='' that gets the job done.

An interesting issue has arisen though now that I'm revisiting the code. In another thread on these forums a user asked about sorting international characters without adding the individual characters to the alpha list so if someone pressed O they'd also get &Ograve;, &Oacute; and &Ocirc; etc...

Though technically completely different individual characters it might be helpful to include such functionality.

As you probably became aware in your modification the strtoupper call isn't cut out for internationalization issues. I'm now trying to put my head around the issues on the front-end such as the array list, should you have something like
Code:
$letters = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', array('o','&Ograve;','&Oacute;'), 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z');

Use the first one for display but the others for comparison to enable/disable the O. Or use JLanguage::transliterate to compare.

How did you build your list, from the language ini's?

Jw

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

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.308 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline