2 of 27
2
Tome (Static Pages)
Posted: 15 October 2006 12:50 PM   [ Ignore ]   [ # 19 ]  
Grad Student
Rank
Total Posts:  97
Joined  03-30-2004

That worked thanks.

So I have created a category called Home in the content pages blog.  I want to make sure Im getting this.

So I should now edit the index template…

stuff

{exp:weblog:entries category=“Home”}.

stuff

.....

then if I create a category called “About Us” ... I would then create a new template called “About Us” and in that


stuff

{exp:weblog:entries category=“About Us”}.

stuff

.....

Then in my navigation I would just hardcode the value for about us ... http://website.com/aboutus/


Hope that makes sense.

Also to add ... or is it just one template for the static stuff, that is how the below is.

http://cms.jobscience.com/home/
http://cms.jobscience.com/news/

Profile
 
 
Posted: 16 October 2006 09:24 AM   [ Ignore ]   [ # 20 ]  
Research Assistant
RankRankRank
Total Posts:  978
Joined  06-13-2005

But if I want to have 200+ static pages (I’m going to create such a section). I don’t like the idea to create 200+ templates.

What to do in this case?

Thanks.

 Signature 

tulks.com

Profile
 
 
Posted: 16 October 2006 10:13 AM   [ Ignore ]   [ # 21 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15450
Joined  05-15-2004

I’d use 200 entries in a “static” weblog together with an appropriate template. Nothing new there, really.

 Signature 

Everything will be good in the end. If it’s not good, it’s not the end.

Profile
MSG
 
 
Posted: 16 October 2006 10:35 PM   [ Ignore ]   [ # 22 ]  
Research Assistant
RankRankRank
Total Posts:  978
Joined  06-13-2005

I see the Module doesn’t support nested categories (or there’s a bug). I wrote an Article in a Subcategory, and I see it at an upper level.

 Signature 

tulks.com

Profile
 
 
Posted: 17 October 2006 09:05 AM   [ Ignore ]   [ # 23 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1184
Joined  01-05-2006

Ingmar: I’m not sure I understand what you mean?  Are you saying that even without the extension you would need to build 200+ templates.

sigork: The module does support nested categories.  You just have to set them up under the Admin » Weblog Admin » Categories tab.  (What version of EE are you using?)

 Signature 

================================================
    Mark Huot
    http://markhuot.com
================================================

Profile
 
 
Posted: 17 October 2006 09:12 AM   [ Ignore ]   [ # 24 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15450
Joined  05-15-2004

No, of course not. Whenever I have to handle static pages, I build a “static” weblog, and a “static” template. Then I use something like www.example.com/index.php/site/static/about_us, where “About us” is an entry in a weblog. Makes sense? Pretty standard procedure, really.

 Signature 

Everything will be good in the end. If it’s not good, it’s not the end.

Profile
MSG
 
 
Posted: 17 October 2006 09:22 AM   [ Ignore ]   [ # 25 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1184
Joined  01-05-2006

Ahh, I see.  We’ll stay tuned.  I’m looking into hooking this up to the template manager for the next release!

 Signature 

================================================
    Mark Huot
    http://markhuot.com
================================================

Profile
 
 
Posted: 17 October 2006 02:22 PM   [ Ignore ]   [ # 26 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1184
Joined  01-05-2006

Here’s an update for you!  The extension now interacts with the template system.  To do this go into the pages module and choose to configure the module.  There you will see two lists, one to choose a weblog (as defined in my previous tutorial) and the other to choose a static template.  This template will be used whenever a user navigates to a static page.

Static pages are defined by the category structure associated with the weblog you choose.  They are generated by the category name, so let’s take the following structure and see how this works:

About
—Staff
——We’re Hiring
——Submit Your Resume
—Directions
News
Legal
—Privacy Polity
—Terms and Conditions

Normally (assuming you haven’t made a template called “about” in your site) navigating to /about would bring you to a 404 or the site homepage.  Now with my module/extension navigating to /about will bring you to the static template you defined.  Likewise, navigating to /about/staff/submit_your_resume will bring you to the static template you defined.  You’ll notice the url structure is created by converting spaces to underscores and the entire string to lowercase.

Finally, on the static page template you have access to three new global variables:

1. {static_page} which returns the category of the page you are viewing, helpful for {exp:weblog:entries category=”{static_page}”}
2. {static_page_name} which returns the category name you are viewing
3. {static_page_short_name} which returns the url of the static page you are viewing (so something like submit_your_resume).

I’ll be writing another tutorial on this soon, but hopefully this will help out in the meantime.

 Signature 

================================================
    Mark Huot
    http://markhuot.com
================================================

Profile
 
 
Posted: 17 October 2006 02:25 PM   [ Ignore ]   [ # 27 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1184
Joined  01-05-2006

Ingmar: this should allow for a much cleaner url structure than you detailed by removing the site/static section and turning this:

www.example.com/index.php/site/static/about_us

into this:

www.example.com/index.php/about_us

let me know what you think.

 Signature 

================================================
    Mark Huot
    http://markhuot.com
================================================

Profile
 
 
Posted: 17 October 2006 02:32 PM   [ Ignore ]   [ # 28 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15450
Joined  05-15-2004

Well, my example was the base way of doing it. You can, of course, remove both the template group as well as the template, using the default values, so URLs like

www.example.com/about_us

are easily possible. Having said that, I’ll give the extenskion a whirl.

 Signature 

Everything will be good in the end. If it’s not good, it’s not the end.

Profile
MSG
 
 
Posted: 19 October 2006 12:20 PM   [ Ignore ]   [ # 29 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  276
Joined  06-12-2002

okay, i’m stuck. Installed, had some sort of weirdness, now can’t remove and can’t reinstall. Getting the following error when i try either to remove or to go to the module page:

MySQL ERROR:

Error Number: 1146

Description: Table ‘db_adrienne_main.mod_pages’ doesn’t exist

Query: SELECT type, value FROM mod_pages WHERE name=’‘

If someone can just send me an SQL statement to construct the mod_pages table, i can probably take it from there.

Thanks,
Adrienne

Profile
 
 
Posted: 19 October 2006 12:27 PM   [ Ignore ]   [ # 30 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1184
Joined  01-05-2006

Here you go!

CREATE TABLE IF NOT EXISTS `mod_pages` (
`id` INT(6) UNSIGNED NOT NULL AUTO_INCREMENT,
`type` VARCHAR(255) NOT NULL ,
`name` VARCHAR(255) NOT NULL ,
`value` VARCHAR(255) NOT NULL ,
PRIMARY KEY (`id`));

 Signature 

================================================
    Mark Huot
    http://markhuot.com
================================================

Profile
 
 
Posted: 19 October 2006 12:35 PM   [ Ignore ]   [ # 31 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  276
Joined  06-12-2002

Thanks!! That got it!

I’m with everyone else, mark—pMachine should pay you!

—Adrienne

Profile
 
 
Posted: 19 October 2006 12:51 PM   [ Ignore ]   [ # 32 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1184
Joined  01-05-2006

Alright, another update for everyone.  This one adds a setting to the extension which allows you to set wether the extension should override existing templates, because before it would no matter what.  Enjoy and grab it at the top of this thread, it should be version 2.0.0, or 200.

 Signature 

================================================
    Mark Huot
    http://markhuot.com
================================================

Profile
 
 
Posted: 19 October 2006 12:54 PM   [ Ignore ]   [ # 33 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  276
Joined  06-12-2002

also, a suggestion for the next version:

allow EXTRA URL Segments at the end to override the default template. So while going to:

/about/staff/submit_your_resume

goes to the submit your resume page, default template, going to:

/about/staff/submit_your_resume/store/static

goes to the same page but with the store/static template!

—Adrienne

Profile
 
 
Posted: 19 October 2006 01:03 PM   [ Ignore ]   [ # 34 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1184
Joined  01-05-2006

Ahh, we’ll you’re one post ahead of me.  I’m planning on offering configurable (per category) templates in the module, it won’t be in the url, but you will be able to set exactly which template each category uses.

Is there a reason you requested this ability specifically in the url?  Currently one method you could use is on the static page template, place a few conditionals that basically display different pages based on the {segment_x} variables?

 Signature 

================================================
    Mark Huot
    http://markhuot.com
================================================

Profile
 
 
Posted: 19 October 2006 01:19 PM   [ Ignore ]   [ # 35 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  276
Joined  06-12-2002

Well, in the URL because occasionally i’d want to use the SAME info (“Contact Us”, for instance) with several DIFFERENT templates. I run about 6 different personal projects with my one EE installation, and obviously my contact info doesn’t change between them all!

I *could* do it all in one template, but WOW that would be a lot of conditionals. Include this header, this footer, this set of body tags, etc….

Certainly being able to configure per category would be great, though, and would solve easily 95% of my problems—just not the other 5%. smile So, solve those, and i’ll deal with the conditionals.

The only other question is, when can we have it? smile

—Adrienne

Profile
 
 
Posted: 19 October 2006 02:19 PM   [ Ignore ]   [ # 36 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1184
Joined  01-05-2006

alright alienne, check it out now.  I’ve added per-page template choices.  You can find it at the bottom of the configure tab.  As always get the latest update at the top of this thread.

 Signature 

================================================
    Mark Huot
    http://markhuot.com
================================================

Profile
 
 
   
2 of 27
2
 
‹‹ Solspace Tag Cloud      Files Module ››
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 65030 Total Logged-in Users: 22
Total Topics: 82119 Total Anonymous Users: 17
Total Replies: 441328 Total Guests: 173
Total Posts: 523447    
Members ( View Memberlist )
Newest Members:  cfvicdreamNOIRgmonCooperWrightReedsmeenoiYang.JianuoioitsukiNathan Hammondalexcig