tags
and other content that will be generated by that template file).
IT MAY BE EASIER FOR YOU TO LOOK FOR "get_footer()" (which template files MAY
use for displaying a footer for your theme). Then, place the function call
to the template function at some point above that line.
You will need to take care in doing this, as YOU ARE CHANGING THE LAYOUT
OF YOUR SITE. Make certain your Zazzle Store Grid will appear properly
nested inside of any appropriate
sections, or outside all
sections (if that makes sense for your Wordpress theme).
(see "LIMITATIONS" in "/README.txt")
Create ZSTORE_GRID sections as you would for the INLINE METHOD (described
above).
YOU MUST SET "GRID_EXPAND_INLINE=false" IN EACH "ZSTORE_GRID" SECTION.
Advantages
- use of any part of your site layout for displaying store
grid(s) (does not need to be restricted to the part of
the layout in which page/post content is displayed).
- include absolutely anything else along with, above, below,
floating over, etc your store grid(s). You are limited by your
creativity and skills.
- still uses the same mechanism for storing ZSTORE_GRID information
(directly in page/post) so it is still easy to edit or add more
ZSTORE_GRID sections.
- the examples (below) show how you might restrict access to only
logged-in users (perhaps useful for editing ZSTORE_GRID sections
on a production system w/o worrying about non-logged-in users
being able to see the Zazzle Store yet).
- the examples (below) show how you would be able to conditionally
enable or disable store visibility based on a flag (the first
parameter). To fully implement this conditional enabling/disabling,
YOU MUST PASS EITHER true OR false AS DETERMINED BY SOME OTHER
MECHANISM THAT YOU DESIGN YOURSELF. The underlying code simply
supports being told whether to be "on" or "off"
Disadvantages
- with more flexibility comes more room for confusion and error
- requires being brave enough to edit your template files (it is
not that difficult)
- does not display inline with other content that you may write between
your ZSTORE_GRID sections, but instead is displayed with only the
relative order of the ZSTORE_GRID sections intact (most likely after
the Wordpress loop).
- content written between ZSTORE_GRID sections will appear separate
from the resulting Zazzle Store Grids.
Example function calls...
In these examples, the function "is_user_logged_in()" is a Wordpress-
provided function that returns true/false based on whether the person
visiting the site is a logged-in user. FEEL FREE TO USE ANY OTHER
CRITERIA YOU WANT (or none at all).
... or ...
//allow only logged-in users to see the store
//(also displays default warning message about store being hidden)
DFDzstore_ShowZazzleGrids( false ); //store is NOT visible to all visitors
is_user_logged_in() ); //if true, current site visitor CAN see the store anyway
... or ...
//allow only logged-in users to see the store
//(also displays a CUSTOM warning message about store being hidden)
DFDzstore_ShowZazzleGrids( false ); //store is NOT visible to all visitors
is_user_logged_in(), //if true, current site visitor CAN see the store anyway
true, //show custom warning message to visitors who CAN see the store
"Only logged-in visitors can see the store" ); //custom message
... or ...
//allow only logged-in users to see the store
//(does NOT display any warning message about store being hidden)
DFDzstore_ShowZazzleGrids( false ); //store is NOT visible to all visitors
is_user_logged_in(), //if true, current site visitor CAN see the store anyway
false ); //do NOT show warning message to visitors who CAN see the store
Make sure you wrap the function call (and comments) between ""
if necessary (see the first example above). Those "tags" tell the web server
to execute the PHP code in those lines (vs returning those lines as text).
See "/sample_index.php" for a small example.
It is wise to verify that the function exists - "if( function_exists(...))" -
since disabling the "dfdZazzleStore" plugin in your Wordpress admin
control panel would make the function no longer exist as far as Wordpress
is concerned. See "LIMITATIONS" in "README.txt" for other issues regarding
disabling the "dfdZazzleStore" plugin.
In the above examples, when a warning message is displayed, it appears
ALONG WITH THE STORE, visible to the person ACTUALLY VIEWING THE STORE.
Absolutely no store information is visible to people who CANNOT see the
store, including the warning message.
In such a case, the warning message may be useful as a reminder to the
person editing the ZSTORE_GRID sections to re-activate the store for
everyone when he/she is done..
Read comments above the function "DFDzstore_ShowZazzleGrids()"
in "/_zazzlestore.php" for additional information.
(3) PSEUDO STAND ALONE METHOD...
If the above two methods sound too complicated, and if you are comfortable
copying/pasting/modifying existing code to meet your needs...
- INSTALL "dfdZazzleStore" AS DESCRIBED ABOVE (for Wordpress installations)
- read "/README_STANDALONE.txt"
- see "/include/_standalone.php"
- MAKE SURE YOU READ ALL OF THE CODE COMMENTS IN "_standalone.php".
- YOU WILL STILL NEED TO EDIT A TEMPLATE FILE FOR YOUR WORDPRESS THEME,
but you will NOT need to define any ZSTORE_GRID sections in any
page/post on your site. That is the primary difference between
Method 2 (above) and Method 3 (here).
Advantages
- use of any part of your site layout for displaying store
grid(s) (does not need to be restricted to the part of
the layout in which page/post content is displayed).
Disadvantages
- you still must edit a template file - see "(2) TEMPLATE FUNCTION METHOD" above
- store configuration will appear in a separate file that must
must be edited in order to change anything.
- less easy to edit store configuration.
WHAT OTHER "GRID_CONIGURATION_VARS" ARE AVAILABLE...
See "GRID_CONFIGURATION_VARS" in /README.txt
CONTACT THE AUTHOR
http://www.electricdarrell.com/