Announcement

Collapse
No announcement yet.

Blocks tutorial 5: Mis-use of custom variables. Sale now on!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Blocks tutorial 5: Mis-use of custom variables. Sale now on!

    Synopsis
    Ok, so we made some lists of products, and we made some clever navigations. what next? Make our own lists!

    Actinic has some marketing features, but its only got a few types of usable lists in V8, namely, the best sellers and the new items. But we can have so much more.

    What about these:
    - Managers specials
    - Sale now on!
    - Price ranges
    - Arbitrary groups of items, such as brands.


    Creating a custom special list
    We're going to create a list to demonstrate this advanced technique. We're going to call it Gabriel's Deals. In it, we'll be creating a special group, and putting some items into it, from our catalog. then, we'll be displaying them in our tempaltes.

    Step 1, making a special variable.
    - Open the library {Design > Library...}
    - Click the Variables tab.
    - Right click in a blank space and click 'New Group'.
    - Call it 'MyLists'
    - Right click on our new group 'MyLists'. Click 'New Variable'
    Name: GabrielsDeals
    Prompt: GabrielsDeals
    Place of setting: Product
    Tab: Marketing
    Type: True/False
    Initial Value: False
    - Click ok, and then 'Close'.

    OK! we just made a new property, that allows us to choose if an item appears in our list. Now, pop into your catalog, and find some products. go to the marketing tab and then set a few items to yes. I did about 5 ish.

    ok, so whats the code?

    Well, i'll assume that you can now expand on blocks, so i'm only going to give very simple markup, so you can add to it later.

    Code:
    <div>
    <actinic:block type="EntireSectionList" >
    <actinic:block type="ProductList" >
    	<actinic:block if="%3cactinic%3avariable%20name%3d%22GabrielsDeals%22%20%2f%3e%20%3d%3d%20true" >
    			&pound;<actinic:variable name="ProductPriceRaw" />: <actinic:variable name="ProductName" /><br>	
    	</actinic:block>
    </actinic:block>	
    </actinic:block>
    </div>
    OK, so whats goind on here? Well first of all, due to the nature of Actinic when we loop a set of products, like this:
    Code:
    <actinic:block type="ProductList" >
    Actnic will list only the products that are in the current scope. that is, only products on the current page. To get around this, we loop all the sections, and then list all the products inside that. Like a loop inside a loop. See? This in effect lists all the products that there are in the shop.

    We needed to limit that, to only products that we have chosen to be in our list. So, we use a simple blockif. that says in english:
    'Show this item if GabrielsDeals is true'.

    So, basically, we only show items in this list, that have this variable set to true. Actinic can deal with lots of these lists. so you can really go to town on the phrases you choose. Managers specials, deals, the lot. Go add some more markup and a link like i showed you earlier, and you have got yourself another marketing concept.

    Did you say price ranges?
    YES! i did. ok, so how do we do this?

    Luckily, we dont need to create a variable for this. We already ahve one. you ahve the prices as a part of your products (or you should have).

    ok, so, lets dive in with an example:
    Code:
    <div id="prices">
    <actinic:block type="EntireSectionList" >
    <actinic:block type="ProductList" >
    	<actinic:block if="%3cactinic%3avariable%20name%3d%22ProductPriceRaw%22%20%2f%3e%20%20%3c%3d%2015" >
    			&pound;<actinic:variable name="ProductPriceRaw" />: <actinic:variable name="ProductName" /><br>	
    	</actinic:block>
    </actinic:block>	
    </actinic:block>
    </div>
    How does this work? Well, you may ahve noticed that the last example included the price of the item in the list too. we can use this price to make comparisons as well.

    Our blockif in this one does not limit to the GabrielsDeals variable, it limits based on the price. In english?
    'Show this item if the price is less than 15'

    of course depending on your currency, you'll need to change some things, namely the pound sign, but its the number we're interested in. Using what you've learned earlier, you can easily change the amount thats filtered, or even make a list showing a price range, between two numbers.

    Brand lists?
    The idea for brand lists is a similar one to the last we made first in this tutorial. In this, we have a variable that is of type 'text'. then we type the brand name in there.

    Assign each product a brand, then create a list like the ones above, that show only those brands that equal a brand you choose. Make a new block for each 'Brand'. When you have a new brand, then make a new block.

    You can use ideas picked up earlier, to make all sorts of lists, and dropdown boxes for this idea, try it.

    And finally...
    Are you all seeing the things you can get up to with blockifs? I want no more daft noobie questions about them from now on mind you!

    There might be some more tutorials later, when I can think of soemthing clever to use blocks for. Until then, happy blocking, Actinites.

    ps: these tutorials will be also posted on my site at:
    http://www.interact-studio.co.uk/int...utorial-1.html
    http://www.interact-studio.co.uk/int...utorial-2.html
    http://www.interact-studio.co.uk/int...utorial-3.html
    http://www.interact-studio.co.uk/int...utorial-4.html
    http://www.interact-studio.co.uk/int...utorial-5.html

    in case they get lost here for any reason.

    khnxbai

    - GC

    #2
    Hi Gabe,

    I hope you get a lot of thanks for this little lot!!

    Awesome is not really part of my vocabulary, but what you have added to day is surely just that!

    Well done and thank you.

    David
    -----------------------------
    www.synchronisedwebdesign.com
    Location: North Yorkshire UK

    Comment


      #3
      GC, Love your work,
      Just used this + a few more custom settings to create pages which show all products by brand.
      Not a duplicate product in site + no running through the cgi bin search so search engines will be happy as well.
      http://community.actinic.com/showthr...280#post212280

      regards
      bangers
      Boxhedge New Media Design
      Design and development solutions for SME's.
      Tel: 0118 966 2786
      Examples of work can be found at http://www.boxhedge.com

      Comment


        #4
        Hi Guys..need help if you can?

        Thanks Gab,

        Great job...thanks..I ham getting a bit less stupid with actinic now.

        I have a site above 10 thousands sections (around 13 thousands I think..).
        Here it is : http://www.bijoux-piercing-france.com
        Reason is : I have one product per page, and like it like that.

        For google, I wanted to use and tried some of your codes, to obtain on every page, quick links of what contains only the subsections as the tree is going quite deep, and wanted to keep every page of the site within 3 clicks. I went into the appearence tab and changed the "EntireSection" to show "Childsection".

        It works, but only for the first page down the tree..I have tried many things, but it seems that when you use ChildSection variable, it only goes one page down, and I would need to go as far as there are sections.

        Any idea onto how to achieve that ?

        These blockifs are great and it's opening my eyes on the search engine side of things, as when you have a lot of products, you are pretty stuck..but a piece of code like this could change a lot of things...and I am sure I am not the only one.

        thanks
        Patrick
        Patrick
        http://www.body-piercing-jewellery.com/
        http://www.bioflex-wholesale-body-pi...suppliers.com/
        http://www.jewellery-stones-supplies.com

        Comment


          #5
          Tutorials

          Hi Gabe.

          The tutorials are great, but I would love to be able to print a hard copy to read at leisure, and leave on the desk for reference when designing. The text in those "frames" spoils that a bit as some of it gets lost in printing.
          Any chance of ditching them? Keep up the good work
          Steve Griggs.

          "People in business often miss opportunities, mainly because they usually arrive dressed in overalls and looking like work."



          www.kitchenwareonline.com
          www.microwave-repair.co.uk

          Comment


            #6
            i copy and paste into notepad, it requires a separate copy for each code block. but its done "in frames" so the page doesn't loose width.

            Comment


              #7
              Help needed

              I have posted a similar article elsewhere but haven't got a response yet. Was hoping that one of you guys may know a solution:

              I'm working on a site which uses standard categories but also wants to have brands. I have created a custom variable for brand which can be entered on each product. I have included this custom variable as a searchable property which works great.

              The issue I'm having is with trying to generate a simple list of the brands that will appear at the top of the site. What I've got working so far obviously isn't right as I seem to be getting some odd sort of loop where the brands are being repeated. You can see this at http://www.pixelcreation.co.uk/ie-store/

              Each brand link does actually work and is basically using the search to show the appropriate products.

              The code I'm using is below, which is simply getting wrapped within <li>code</li>

              Code:
              <actinic:block type="EntireSectionList" >
              <actinic:block type="ProductList" >
              	<actinic:block if="%3cactinic%3avariable%20name%3d%22InspirationalElementsBrand%22%20%2f%3e%20%3d%3d%20true" >
              			<a href="http://www.pixelcreation.co.uk/ie-store/cgi-bin/ss000001.pl?RANDOM=NETQUOTEVAR%3ARANDOM&PAGE=SEARCH&SS=&PR=-1&TB=A&S_InspirationalElementsBrand0_0=<actinic:variable name="InspirationalElementsBrand" />&GB=A&SX=0&ACTION=Search">
              				<actinic:variable name="InspirationalElementsBrand" />
              			</a>
              	</actinic:block>
              </actinic:block>
              </actinic:block>
              Can anyone help sort out this loop, getting very stuck now
              Web . Design . Multimedia . Branding

              Comment


                #8
                I read this as you want to scan through all your products and make a list of every Brand that's beed used. Some brands will be used many times but you want the list to only contain single unique items.

                You will need to loop through all Sections and then all Products. In the inner loop you'll need some PHP that stores the Brand into a Hash along with a dummy value. Once that's done, some more PHP (which comes after the end of the two loops) should loop over the hash and display all the names there. Not trivial. Luckily there's lots of online PHP tutorials and help available.
                Norman - www.drillpine.biz
                Edinburgh, U K / Bitez, Turkey

                Comment


                  #9
                  Hi Norman,

                  Yep, you read it correctly. That's exactly what I'm trying to achieve.

                  It certainly doesn't sound trivial, but thanks for your pointers. I'll try and figure it out.
                  Web . Design . Multimedia . Branding

                  Comment


                    #10
                    Hey Gab,

                    I am trying to get the product thumbnails into the upper section images up the tree..I have imported all the pictures with the sections but the middle sections up to the to are empty and I am pulling my hairs trying to get a quick fix with the thumbnails..

                    What I would like basically, is to take the first productthumbnail down the line, and pull it to the upper section for each section of the 10K sections in the damn shop..so in middle sections, it would take also the first thumb taken from the first subsection, and so on..

                    Reading your tutorial, I managed to figure out the loop inside the loop, e.i, entire sectionlist, productlist..this is what I got:

                    <div class="product_list">
                    <div class="image_product"><a href="<actinic:block if="%3cactinic%3avariable%20name%3d%22IsLoginPageSuppressed%22%20%2f%3e%20AND%0d%3cactinic%3avariable%20name%3d%22UnregCustomersAreNotAllowed%22%20%2f%3e" ><actinic:variable name="SectionPageName" /></actinic:block><actinic:block if="%28%3cactinic%3avariable%20name%3d%22IsLoginPageSuppressed%22%20%2f%3e%20%3d%3d%20false%29%20OR%0d%28%3cactinic%3avariable%20name%3d%22UnregCustomersAreNotAllowed%22%20%2f%3e%20%3d%3d%20false%29" ><actinic:variable name="SectionURL" /></actinic:block>" target="_self">
                    <img alt="<actinic:variable name="SectionName" encoding="strip"/>" src="<actinic:block type="EntireSectionList" ><actinic:block if="%3cactinic%3avariable%20name%3d%22SectionImageFileName%22%20%2f%3e%20%3d%3d%20%22%22" ><actinic:block type="ProductList" ><actinic:variable name="ProductThumbnailImageFileName" /></actinic:block></actinic:block></actinic:block><actinic:block if="%3cactinic%3avariable%20name%3d%22SectionImageFileName%22%20%2f%3e%20%21%3d%20%22%22" ><actinic:variable name="SectionImageFileName" /></actinic:block>" border="0" /></a></div>
                    <div><h3 class="product"><a href="<actinic:block if="%3cactinic%3avariable%20name%3d%22IsLoginPageSuppressed%22%20%2f%3e%20AND%0d%3cactinic%3avariable%20name%3d%22UnregCustomersAreNotAllowed%22%20%2f%3e" ><actinic:variable name="SectionPageName" /></actinic:block><actinic:block if="%28%3cactinic%3avariable%20name%3d%22IsLoginPageSuppressed%22%20%2f%3e%20%3d%3d%20false%29%20OR%0d%28%3cactinic%3avariable%20name%3d%22UnregCustomersAreNotAllowed%22%20%2f%3e%20%3d%3d%20false%29" ><actinic:variable name="SectionURL" /></actinic:block>" target="_self"><actinic:variable name='SectionName'/></a></h3></div>
                    <p><actinic:variable name='SectionDescription'/></p>
                    </div>

                    Not working...Can you tell me what I am doing wrong ?

                    Seen your ultra fast directory..will surely call you for other things, and will be put my products in it too..
                    Patrick
                    http://www.body-piercing-jewellery.com/
                    http://www.bioflex-wholesale-body-pi...suppliers.com/
                    http://www.jewellery-stones-supplies.com

                    Comment


                      #11
                      OOops! Sorry for the mess, I just discovered (thanks to Norman) I had to put the [Code] Tags...here it is:

                      Code:
                      <div class="product_list">
                      			<div class="image_product"><a href="<actinic:block if="%3cactinic%3avariable%20name%3d%22IsLoginPageSuppressed%22%20%2f%3e%20AND%0d%3cactinic%3avariable%20name%3d%22UnregCustomersAreNotAllowed%22%20%2f%3e" ><actinic:variable name="SectionPageName" /></actinic:block><actinic:block if="%28%3cactinic%3avariable%20name%3d%22IsLoginPageSuppressed%22%20%2f%3e%20%3d%3d%20false%29%20OR%0d%28%3cactinic%3avariable%20name%3d%22UnregCustomersAreNotAllowed%22%20%2f%3e%20%3d%3d%20false%29" ><actinic:variable name="SectionURL" /></actinic:block>" target="_self">
                      <img alt="<actinic:variable name="SectionName" encoding="strip"/>" src="<actinic:block type="EntireSectionList" ><actinic:block if="%3cactinic%3avariable%20name%3d%22SectionImageFileName%22%20%2f%3e%20%3d%3d%20%22%22" ><actinic:block type="ProductList" ><actinic:variable name="ProductThumbnailImageFileName" /></actinic:block></actinic:block></actinic:block><actinic:block if="%3cactinic%3avariable%20name%3d%22SectionImageFileName%22%20%2f%3e%20%21%3d%20%22%22" ><actinic:variable name="SectionImageFileName" /></actinic:block>" border="0" /></a></div>
                      			<div><h3 class="product"><a href="<actinic:block if="%3cactinic%3avariable%20name%3d%22IsLoginPageSuppressed%22%20%2f%3e%20AND%0d%3cactinic%3avariable%20name%3d%22UnregCustomersAreNotAllowed%22%20%2f%3e" ><actinic:variable name="SectionPageName" /></actinic:block><actinic:block if="%28%3cactinic%3avariable%20name%3d%22IsLoginPageSuppressed%22%20%2f%3e%20%3d%3d%20false%29%20OR%0d%28%3cactinic%3avariable%20name%3d%22UnregCustomersAreNotAllowed%22%20%2f%3e%20%3d%3d%20false%29" ><actinic:variable name="SectionURL" /></actinic:block>" target="_self"><actinic:variable name='SectionName'/></a></h3></div>
                      			<p><actinic:variable name='SectionDescription'/></p>
                      		</div>
                      Patrick
                      http://www.body-piercing-jewellery.com/
                      http://www.bioflex-wholesale-body-pi...suppliers.com/
                      http://www.jewellery-stones-supplies.com

                      Comment


                        #12
                        How much is this dead horse up for sale?

                        Comment


                          #13
                          Originally posted by leehack View Post
                          How much is this dead horse up for sale?
                          I'll bagsie the tail. I could do with some hair extensions..
                          Tracey

                          Comment

                          Working...
                          X