1. Hugh (cheesegrits) here. Thank you for all the good wishes. My back surgery was a success, post-op recovery is going well, and I'm getting stronger and feeling better every day. I hope to be getting back in the saddle and working support again over the next few days.
  2. IMPORTANT NOTE - we have made some changes in our github branch naming. The 'master' branch no longer exists, and is now called 'joomla25' (which is Fabrik 3.0). The 'joomla3' branch (which is Fabrik 3.2) remains unchanged. We have also removed all the other testing branches which had accuulated over the last few years. I have posted a thread in the Community forum for 3.0 with some more information, feel free to as questions there.

Local beer store

Discussion in 'Showcase' started by FredSavage, Dec 9, 2011.

  1. FredSavage New Member

    Level: Community
    http://www.primoscraftbeer.com/

    Here is a local (local to me) store that sells specialty craft and import beer. I used Fabrik for the majority of the sites functionality. The admin for the site has no reason to ever log into the joomla backend because all basic site functions are in the frontend via Fabrik. For instance, the Nivo Slider on the homepage is a series of Fabrik detail views and the tables template is what renders the slider effect.

    Last thing I need to work on are the sef url's.
    Thank you so much for Fabrik! It's about the only component I install on my Joomla sites anymore.
    2 people like this.
  2. MatthewSchenker New Member

    Level: Community
    Fred,
    Very impressive! Not only do you show off what Fabrik can do, I think you also show off what Joomla can do.

    Are you using Fabrik version 3 for this?

    Thanks,
    Matthew
  3. rackem Well-Known Member

    Level: Community
    Very cool! Both from a website perspective and coming from a microbrew beer lover.

    Would you be so kind as to briefly describe how you did the Tags? Your presentation is super intuitive and really very useful for narrowing down a huge and delicious range of choices. Is that done with Fabrik?
  4. FredSavage New Member

    Level: Community
    Thank you! The version I used for this site was Fabrik 2. The second that a Fabrik 3 RC comes out, i'll be using v3 from that point on for sure.

    Here are the basics for the tag cloud I set up.
    The form for adding a beer has a checkbox element named tags. I set it so that new tags (checkbox items) can be added at will by the person admining the site.

    [IMG]

    Then I used the mod_tagcloud module that comes with the Fabrik 2 svn files to make the tag cloud itself. Since the fabrik checkbox default separator is "|-|", I set the tag cloud module to use that as its seperator as well.

    [IMG]

    Then you'd want to set the tag url to something like "index.php?option=com_fabrik&view=table&tableid=#&Itemid=#&resetfilters=1&primos_beer_list___tags=" replacing the #'s with the appropriate table and itemid.

    Pretty easy, and all done with Fabrik!

    Attached Files:

    2 people like this.
  5. rackem Well-Known Member

    Level: Community
    I am enjoying an Ale Asylum Ambergeddon as I read your post. ;D Awesome! Thank you very much for thoroughly explaining this. I had been wondering how to do tags for my site when I stumbled across this post.

    I don't see that the tag cloud module is or will be available for Fabrik v3. I hope it is; this is really a useful and user-friendly feature.
  6. MatthewSchenker New Member

    Level: Community
  7. FredSavage New Member

    Level: Community
    Yeah, I used some heavily modified templates for the tables and form views. It's pretty complicated to explain, but i'll try.

    The way the default table template is set up is so that the html for each element is created inside of the foreach statement of the default_row.php file. I wanted to have more control over each individual element, so I instead defined php variables for each element inside of the foreach loop, then generated the html afterwards. For example.

    PHP:
    <?php
    foreach ($this->headings as $heading => $label) {
        $beerTitle = $this->_row->data->primos_beer_list___beer_name_raw;
        $beerDescription = $this->_row->data->primos_beer_list_beer_beer_desc_raw;
    }
    ?>
    <div class="title"><?php echo $beerTitle; ?></div>
    <div class="description"><?php echo $beerDescription; ?></div>
    You can see, I have full control over how the table template will look now. But there is a downside that if you decide to ever add new elements to fabrik, you must add them to the template as well, or they wont show up in the view.

    The detailed view is much the same, but is inside the form templates default_group.php file. Also, I use the element label to make these views. For example.

    PHP:
    <?php
    foreach ($this->elements as $element) {
        if($element->label_raw == 'Beer Name'){ $title = $element->element_raw; $titleHtml = $element->element; $titleError = $element->error; }
    }
    ?>
    <div class="title"><?php echo $title; ?></div>
    Again, I create the html outside of the foreach loop so that I can build the template any way I want. Notice the differences in the variables I set up being element->element_raw, element->element, and element->error. You can build the forms and the detail views to suit your templating needs using these different variables. Also, I make great use of jFactory::user() to build separate templates depending on whether the viewer is an admin or just a visitor.

    Hope this all makes some kind of sense. There are probably easier ways to accomplish what all I did, but I just used what I knew worked for me. You cant break fabrik with the template files, so just experiment. If something goes horribly wrong, revert back to the default template and start over :p
    1 person likes this.
  8. MatthewSchenker New Member

    Level: Community
    FredSavage,
    Thank you very very much for your post! I've been trying to understand exactly the kind of thing you just explained.

    I'm putting together a real-estate listing site, and I need my client to be able to submit form submissions which turn into "list" and "detail" layouts similar to what you are doing with the various beers (of course, beer is more fun).

    I work simultaneously in Joomla and CodeIgniter, so I always look for ways to get to the PHP stuff. I was a bit confused about how Fabrik handles templates, but it's starting to make more sense to me!

    I'm still in the dark about calling specific fields, but your post helps!

    In my experience, Fabrik comes closer than anything in the Joomla world to a "pure" framework.

    Feel free to post more details of how you accomplished your goals!

    Thanks again,
    Matthew
  9. troester Well-Known Member

    Level: Standard
    In addition to FredSavage's explanations you can have a look at the contacts_custom form template for how to access single elements.
    And at the div table template to display your records "catalog" like.

    As Fred says you can't break anything (at least in table and details view), clone a template and try.
    1 person likes this.
  10. MatthewSchenker New Member

    Level: Community
    troester,
    Excellent!

    I'm looking over the templates now. It helps that you pinpointed the contacts_custom template. There are a lot of templates!

    Using a framework, I've become accustomed to creating views as needed and then calling them in my controllers. But with FredSavage's tips, and yours, and looking at this example, I think Fabrik's system is making more sense.

    OK, I'm glad Fred posted his project here...

    Thanks again,
    Matthew

Share This Page