2012-02-04, 04:39:59
n00dles101 Wrote:The way I'd do this is.
o - install my customfields and pages plugins (shameless plug I know )
o - Add a custom field and call it "image"
o - Create your base page - call it 'portfolio' and leave it blank.
o - Now create each of your pages and make the parent "portfolio"
o - add the following function to your themes functions.php
Code:function getPortfolio(){
$subpages=getChildren('portfolio');
foreach ($subpages as $page){
$title=returnPageField($page,'title');
$image=returnPageField($page,'image');
echo '<li>';
echo "<a href='index.php?id=".$page."'><img src='".$image."' alt='".$title."' /></a><br/>";
echo "</li>";
}
}
o - then in your main template just call "getPortfolio();" where you want to display the list of images....
Hope it helps....
Mike
Plugins are here:
http://get-simple.info/extend/plugin/customfields/22/
http://get-simple.info/extend/plugin/page-caching/65/
I've been searching for something like this, and it sounds like the simplest solution to what I want to do which is similar to what otoom wanted. I do have a question. How would I get this to work with multiple portfolios other than make a different function for each portfolio? "getPortfolio1();", "getPortfolio2(), "getPortfolo3();" etc etc.
Also, will this work if i already have the i18N custom fields plugin installed?
Thanks!