Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: How would you go around this?
@ Gocom – I am wondering if you can help me here (or anyone else for that matter) – your code works beautifully, but I am wondering if that URL could be cleaned up, right now I got bebostation.com/users/?user=username, I was wondering if that could become bebostation.com/users/username or something?
Offline
Re: How would you go around this?
You could ask someone .httaccess + rewrite rule special to do that thing for you. I could do it without Textpattern but I’m not so good at it that I could do it when Textpattern’s rewrites conflict with it.
You could also change the ?user / gps('user') in my code to gps('q') so then it would work with Textpattern’s search functionality. And then it could be rewrited to clean with couple simple teps. It could then also be done with gbp_permanent_links with simple rewrite rule:
/section/search/
And then allow it for section named users. Then the urls would work also with bebostation.com/users/username. But this requires to use the q-request that is also used for Textpattern’s search. Therefor, remember to remove all searchable staff from the content that is used for the users-section.
Cheers!
Last edited by Gocom (2008-01-14 14:21:57)
Offline
Re: How would you go around this?
Darn, I got it to work with search, so the URL is now bebostation.com/users/?q=username, but when I set the redirect from GBP_permanent_links like you told me – I get a blank page, any Idea what’s going on? Here’s the code of my page template:
<txp:output_form form="head" />
<txp:output_form form="header" />
<div id="content">
<txp:output_form form="secondary" />
<div id="primary">
<div class="mainBlock">
<txp:php> if(gps('q')) {echo '<h2>'.gps('q').'’s Skins</h2>';} </txp:php>
</div>
<txp:output_form form="googleSearch" />
<ul id="mainGallery">
<txp:asy_wondertag><txp:article_custom limit="9999" section="skins" form="default" created_by="<txp:php>echo gps('q');</txp:php>" /></txp:asy_wondertag>
</ul>
</div><!--end #primary -->
<txp:output_form form="tertiary" />
</div><!--end #content -->
</div><!--end #container -->
<txp:output_form form="footer" />
Offline
Re: How would you go around this?
draganbabic, this should work:
<txp:output_form form="head" />
<txp:output_form form="header" />
<div id="content">
<txp:output_form form="secondary" />
<div id="primary">
<div class="mainBlock">
<txp:if_search><h2><txp:q />’s Skins</h2></txp:if_search>
</div>
<txp:output_form form="googleSearch" />
<ul id="mainGallery">
<txp:asy_wondertag><txp:article_custom limit="9999" section="skins" form="default" created_by="<txp:q />" /></txp:asy_wondertag>
</ul>
</div>
<txp:output_form form="tertiary" />
</div>
</div>
<txp:output_form form="footer" />
Remember that <txp:q /> is deprecated txp-tag but it works, so if it returns errors don’t worry about them. I use that with gbp_permanent_links for searches and other and it works just fine.
Cheers!
Offline
Re: How would you go around this?
Hi Gocom, this works with gbp_permanent links, but however- it does not output the title now so I had to remove the if_search conditional.
Now this gpb_permanent_links this brought on a new problem – it wrecks this tag that I am using to display categories :(
<txp:category_list section="skins" wraptag="ul" break="li" />
It just defaults all category links to http://bebostation.com/skins and it is present only when the redirect rule is active, as soon as I delete it – it goes back to normal, even if I have limited it to a specific section. An thoughts on that?
There is one more thing I am wondering if it is possible to do – when a skin is added to the site as an article – a custom field is populated called bebo_user_ID that contains the bebo.com user profile of that user. Is it possible to pull that custom field’s value out on the page when viewing that user’s skins? For example – we are viewing user Jim’s skins, and all articles that are created by the user Jim have the same value in that bebo_user_ID filled in. Don’t know if that’s all that smart, but I couldn’t think of a better way to do it. Maybe there is a better way around it? Thanks.
Offline
Re: How would you go around this?
Draganbabic. Yeah, gbp_permanent_links has some issues, like it sometimes screws category lists, section list and pagination links that are output by the default core tags. The wonder is that it happens only sometimes, not always. You could aks gbp to do something to that issue. But it’s some sort of conflict with Textpattern’s rewrite rules – so the fix is quite impossible – even for Mr. Possible.
BTW, bebostation.com is awesome looking – and also works great. I love it completely. It’s so beautiful.
Cheers!
Last edited by Gocom (2008-01-22 04:09:51)
Offline
Re: How would you go around this?
Hi Gocom, and thanks for the nice words about bebostation. This is the second version of the design – I personally liked the first one better, but with this the accent was to up the CTRs on ads, so they are a little bit “in your face”, but that’s the way the client wanted it. Also thanks so much for all your help with my questions. Now if I could just find a way to go around this category listing problem…
Offline
Re: How would you go around this?
draganbabic,
You could handcode them with article_custom, if_different and category1. Another way is do some php magic. In example you could remove that /users/ with php or you could set up new gbp_permanent_links rewrite rule for categories.
In example / category /. Then also categories would be clean. Set that only for default section or categories. Then the category links could or should be fine. If not then you would need to do some php-magic:
$remove = '/skins/?c=';
$where = category_list(array(
'type' => 'article',
'sort' => 'title',
));
$final = strtr($where, $remove, '');
echo $final;
Change the attributes to fit your needs. If you don’t use gbp_permanent_links’ rewrite rule for categories, then the $remove should be /skins.
Cheers!
Offline