Jump to content

Macrura

PW-Moderators
  • Posts

    2,756
  • Joined

  • Last visited

  • Days Won

    40

Everything posted by Macrura

  1. @pwired - i'm sure everyone has a different approach to this. This is how i have approached the last few sites: 1.) in the admin, define fields and templates, and add content. I stay in the backend for a while (and don't bother making the actual php files for the templates). Once the backend is stable (data structure of fields and templates, page tree) and there is enough content then i will start to 'wire up' the front end. 2.) Separately design the frontend, using whatever tools you would usually use, optionally on whatever framework you prefer (foundation, bootstrap); sometimes this part can be as simple as using html5 kickstart, or as complex as going through wireframing process etc.. i like to work with a design that is close to finished before 'wiring' it. 3.) the wiring part is pretty easy; it's good to have a list of all your field names and templates...you can configure the files in various ways, have a look at some of the site profiles for examples of this...
  2. i agree with diogo, in that using classes based on the file extension is what I have seen in practice, for icon display; interesting use of the iconfinder CDN though! Usually if I'm doing anything with icons these days it will be in a icon font, like Entypo, Fontawesome, or Glyphicons which are included in bootstrap; this way you're covered for scaling and retina....
  3. if($page->is("template=home|basic-page")) echo "has template"; @Soma....wow - Page IS ! ... better education through forum
  4. this would be pretty common <?php if ( ($page->template == 'home') || ($page->template == 'basic-page') ) echo "something"; ?>
  5. @matthew and all - thanks for looking; site will grow bit by bit; will be adding a paypal button at some point to purchase a cd, as well as some video and more news/events...
  6. Ok so I think what you are saying that when the homepage renders the content blocks, which are being done with the render method, the check I wrote won't work because the $page object is still not really 'home'; so i get that now, and will edit the code in my post..
  7. @diogo - i thought that in this case the link from the admin was actually rendering the page at it's correct URL, like: /page1/content-block-1 which is why i thought that would work... unless i'm missing something...
  8. Here is a recent site done in processwire: http://licoriceensemble.com/ modules used include formbuilder procache cropimage version control for text fields after save actions based on a template by the great team at Elemis.
  9. you can do the tabs with fields, repeaters or pages; depends on how flexible you need and the specific application. I've done tabs with all 3 scenarios; here are examples – note you will have to use the structure and class/ID names needed by your scenario (bootstrap etc..) 1.) Tabs using 2 fields on a page: <div class="tabs tab-container"> <ul class="etabs"> <li class="tab"><a href="#tab-1">Japanese</a></li> <li class="tab"><a href="#tab-2">English</a></li> </ul> <div class="panel-container"> <div id="tab-1"> <?php echo $page->bio_jp; ?> </div> <div id="tab-2"> <?php echo $page->bio_en; ?> </div> </div><!-- end panel container --> </div><!-- end tab-container --> Example 2 - tabs using repeaters: <?php //check to see if there are tabs if(count($page->tabs)) { ?> <div class="clear"></div> <div class="tabs tab-container"> <ul class="etabs"> <li class="tab"><a href="#tab-0">Additional Album Information</a></li> <?php $counter = 0; foreach($page->tabs as $tab) { $counter++; ?> <li class="tab"><a href="#tab-<?php echo $counter ?>"><?php echo $tab->tab_title ?></a></li> <?php } ?> </ul> <div class="panel-container"> <div id="tab-0"> <p>Please use the tabs to select further info.</p> </div> <?php $counter = 0; foreach($page->tabs as $tab) { $counter++; ?> <div id="tab-<?php echo $counter ?>"> <?php echo $tab->tab_content ?> </div><?php } ?> </div> <!-- end panel container --> </div><!-- end tab container --><?php } ?> Example 3 using child pages (bootstrap) <div class="content-tabs"> <!-- wrapper required --> <?php $tabs = $page->children; ?> <ul class="tabs"> <?php foreach ($tabs as $tabtitle) { ?> <li class="tab"> <a href="#<?php echo $tabtitle->name; ?>"><?php echo $tabtitle->title ?></a> </li><?php } ?> </ul> <div class="panels"> <?php foreach ($tabs as $tabcontent) { ?> <div class="pane" id="<?php echo $tabcontent->name; ?>"> <?php echo $tabcontent->body . "\n"; ?> </div> <!--close #<?php echo $tabcontent->name; ?> --><?php } ?> </div> <!--close panels--> </div> <!-- /.content-tabs-->
  10. <?php $homepage = $pages->get('/'); if($page != $homepage) { // if we're not on the homepage do this $redurl = $homepage->url . "#" . $page->name; // this is where the page will redirect to $session->redirect($redurl); } ?> don't do it this way - it won't work right on the homepage - look at diogo's post below.
  11. Soma's DataTable makes it easy to find/sort/filter large amounts of pages, but AFAIK you can't filter/sort on custom fields. Maybe a custom admin theme or a new admin page for that purpose would be best, with an ajax search for example on the top, and sortable columns..
  12. just tell them not to view page in the admin, or make those pages redirect to the anchor on the homepage, using some php in the template file (?)
  13. @renobird - funny, a few hrs ago i was trying to get my head around how to import CSV data into repeaters... not sure if it is relevant to your question, but it is something i might need to do soon (importing users where phone and email are repeatable)
  14. As far as i can tell it all works as intended - i think the paging buttons are intentional, and the sort order is not intended to toggle, but to sort ascending, so i wouldn't say bugs but maybe needs to be improved a bit this may be relevant: http://community.invisionpower.com/topic/356062-ipboard-seo-paging-issue/?hl=paging
  15. this should be not a problem.. don't reinvent the wheel? just make your tabs (css or jquery based) and then embed your form in the last tab maybe you need to buy some tabs on codecanyon? http://codecanyon.net/item/tabs-accordion/2906434?sso?WT.ac=search_item&WT.seg_1=search_item&WT.z_author=Lamovo http://codecanyon.net/item/zozo-tabs/3327836?sso?WT.ac=search_item&WT.seg_1=search_item&WT.z_author=ZozoUI
  16. i was just saying to make sure that the page you were testing on actually had some images
  17. $product->product_price->label this should work - the cheatsheet says you can do $field->label ( $product->product_price is your field ); i think i have done number_format on something similar, so I would have to say yes to this: "could I use number_format directly on ($product->product_price)"... maybe report back if your results are not as expected
  18. does your error log show anything? Are you sure there is an image uploaded, and the api is considering it a single file (max images 1)? have you tried it on other pages, other templates... might help to narrow down the issue...
  19. What are you using for the select list? Maybe that is messing things up; is this a page select, or hani's module?
  20. what about this, just taking a guess here, that you need to count the actual repeaters before assigning them to a variable? <?php echo 'There are [ '. count($page->widget_group) . ' ] widgets assigned<hr>'; ?> also can you try foreach ($page->widget_group as $item) { because you may be encountering some strangeness by trying to assign what is already a page array into a new variable.
  21. As Soma points out, the issue must be that you have specified to allow multiple pages to be selected, which you shouldn't because you're using the repeaters to handle the adding of widgets, and you have an additional field in the repeater item related to positioning the widget. So it makes sense to limit that page select to 1 page;
  22. right, can you post a bit of those results, so we can see what's in there?
  23. @3fingers - also want to mention that the skyscrapers profile has some interesting examples of how to build the selector from various input.
  24. to me it doesn't seem optional since it's not really the 'widget group name' but is the actual page that is holding the widget, and it's also shorter; unless i have a misunderstanding of your fields and templates names; if you can post the names of all relevant fields and templates including the repeater field, and what fields are inside the repeater i might be able to do better... but from what i see from your post this should work.. can you do a print_r ($group); to see whats in that array? maybe also the same for the $item?
×
×
  • Create New...