Subscribe: Knowledge Base
http://www.buildwithstructure.com/rss/knowledge
Preview: Knowledge Base

Knowledge Base





Published: 2010-05-07T13:52:01+00:00

 



StructureFrame

2010-05-07T13:52:01+00:00

The StructureFrame fieldtype works with Pixel & Tonic’s FieldFrame and is intended to link to other site pages. It gives the user a dropdown menu to select from a list of nested site pages and outputs the page URL when called through templates.




Categories: Sorting and Displaying Content

2010-05-02T21:36:18+00:00

Because Structure relies on exact URLs, the normal way of doing dynamic categories will not work. You can easily replicate this functionality by passing strings. Enable PHP in your template and set parsing to input, then use the following:

Category Links

Link to your categories in the following format: http://domain.com/path/to/page?category=3

In this, 3 is the number of the category you want to display. This can be created dynamically with EE tags.

Displaying The Category Content


{exp:weblog:entries weblog="your-weblog" category="<?php echo $_GET['category']; ?>" dynamic="off"}
{title}
{/exp:weblog:entries}

NOTE: The above character entities need to be replaced with actual brackets, and are blocked by EE as a security measure

Converting To Clean URLs

In your htaccess file, place the following code at the end:


RewriteRule ^path/to/page/([0-9]{4})$ /path/to/page?category=$1 [L]

This will make your category URL look like: /path/to/page/3

Note: This must appear after the rewrite rules:


RewriteEngine On
RewriteBase /



Displaying Comments

2010-05-02T21:35:32+00:00

You can use the page_id tag to call comments on any detail page using the following code:

Comment Entries


{exp:comment:entries entry_id="{exp:structure:page_id}" parse="inward"}

Comment Form


{exp:comment:form weblog="blog" entry_id="{exp:structure:page_id}" parse="inward"}



Conditionally Display Content If A Page Has Children

2010-04-11T18:41:27+00:00


{if '{exp:structure:child_ids}' != '0'}
<p>This page has children!</p>
{if:else}
<p>This page does NOT have children!</p>
{/if}



Multi-Language Sites

2010-01-30T00:19:17+00:00

The recommended method is to have your default language at the top level and make separate branches for your alternate languages like this:

/about
/services
/contact
/es/about
/es/services
/es/contact
/fr/about
/fr/services
/fr/contact

You can then use the nav_sub tag and either the start_from or exclude_status parameters. When using exclude_status you can assign statuses by language to control the output.

Example nav_sub code:


{if segment_1  'es' OR segment_1  'fr'}
	{!-- START FROM SEGMENT 2 IF NOT DEFAULT LANGUAGE --}
	{exp:structure:nav_sub start_from='/{segment_1}/{segment_2}'}
{if:else}
	{!-- START FROM SEGMENT 1 IF DEFAULT LANGUAGE --}
	{exp:structure:nav_sub start_from='/{segment_1}'}
{/if}

This method does not require different custom fields per language as they’re all separate pages powered by the same code and quite often the same templates.




Requirements

2009-11-22T18:44:51+00:00

  • PHP 5+
  • MySQL 5+
  • ExpressionEngine 1.6+ (EE 2.0 compatibility will be released in March 2010)
  • Extension: jQuery for the Control Panel (using jQuery version 1.3.2)



Site License Information

2009-11-22T18:31:56+00:00

Each site license can be used on one public-facing website or intranet at a time. Each MSM-based website counts as one website. You may install Structure on an unlimited number of private, in-development websites. Full refunds are available within 30 days of purchase if you’re not satisfied.




Visiting The Structure Screen Erases My Data

2009-11-22T18:14:53+00:00

Make sure you didn’t create the tab after changing settings or it will append a string that includes info to erase the settings every time you visit. Clear the tab under My Account » Customize Control Panel » Tab Manager and then revisit Modules » Structure to resave it.




Where is The Structure Tab?

2009-11-22T18:13:29+00:00

You have to add custom tabs for yourself through the EE CP.

To add the Structure tab:

1) Go to Modules » Structure
2) In the top right of the CP click “New Tab”
3) Save it




Blank Extension Screen

2009-11-22T18:11:38+00:00

If your extension screen is blank after installing Structure try the following:

  • Verify your PHP version is at least 5
  • Increase PHP memory_limit. In your .htaccess file, place this rule: “php_value memory_limit 16M”
  • Make sure your extension file has the permissions 755
  • Restart MySQL + Apache