Jump to content

Macrura

PW-Moderators
  • Posts

    2,765
  • Joined

  • Last visited

  • Days Won

    40

Everything posted by Macrura

  1. yes, you could definitely use pages to store questions, pages are the 'cellular' object in PW, they can represent anything you want them to, folders, bits of data, chunks, whatever; you could create a template called questions and then another one called question, and then allow only pages with the question template as children of the questions template; then you could import your questions using the csv module or the api.
  2. most editors I've ever seen use <strong> for bold and <em> for italics. it's perfectly fine and not outdated at all, in fact these are semantic http://html5doctor.com/i-b-em-strong-element/ edit: oh and stay away from inline styles if you can.
  3. the templates are really fieldsets - you would have to add the questions field to a template; you could use a repeater field to store multiple iterations of a field on a page; or you could store the 10 questions in a text field and then pull them each out using php, like for example if each question was on a newline, you could easily pull each one out and then foreach through them in order to output them anyway you want, be it <li> or <p>.
  4. i think it would be good to have the stock error message as a default, but at least the option to override it in the field settings; also - i think you could possibly still use the form builder as a processor even if you do your own form markup, as in if you want to be able to take any advantages of the form builder features besides it just creating the form markup
  5. Hi gerhard - the default errors show above each individual field. there is probably an easy way to change it in the code to output below the individual field, though i think above the field looks/feels better - i think that's what Ryan opted to do it that way, it's sort of easier to notice. One thing i did just notice is that there is nowhere to change the required notice text for each field... i'll have to put that in as a feature request, right now if you miss a field it outputs "missing required value" but it would be better to be able to customize each message,like "please enter your first name" above a name field etc..
  6. hey - great site! the macaron tower is crazy!
  7. you mean like this? if($product->sc_price_drop) { $out .= '<del>' . $product->sc_price . " €</del>"; $out .= number_format($product->sc_price_drop) . " €"; } else { $out .= ($product->sc_price ? number_format($product->sc_price) . " €" : $na); }
  8. could you explain more? i'm not really getting what you're trying to do...
  9. Hi Niklas, i guess maybe when you say 'sites' you mean pages? this is something that can already be done pretty easily. for example i just did a site with 3 distinct types of data, classes (as in like an art class), sessions (as in the actual session that the class runs, start/end dates, instructor etc.) and events. For the classes, we setup a parent page called Class Database, and then a custom admin page for viewing the list of classes, and being able to click on one and edit it. the class database page used a template called class-database which only allows the page type class as a child. for sessions those are relational to classes and output on each class, the class is a page select on the session, and there is no template file for the session, so they won't show or be accessible on the front end. the classes are output using url segments and some url 'rewriting' logic that was demonstrated by Ryan's CMS Critic case study.
  10. hi alejandro - cool - glad that's working... and you reminded me that i probably don't need to put the server path, that's why i had the leading slashes, i can include those liek you did since they are in the templates directory...
  11. maybe $results->sort("-blog_date"); see http://cheatsheet.processwire.com/ $a->sort("property") Sorts the WireArray by the given item property (string). You may also specify the property as "property.subproperty", where property resolves to a Wire derived object, and subproperty resolves to a property within that object. Prepend a minus sign "-" to the property name reverse the sort.
  12. right - ok well i wouldn't use the page tree for categories, i would bucket the pages all under 1 page and then use Url Segments for the categorization; i do this for a lot of reasons, but one being that sometimes clients will want something to be in 2 categories. to do what you want to do would be pretty easy though, you would need to run a hook before the pages are saved; for that you might check the formbuilder thread there are some examples of code for running hooks with formbuilder.
  13. really not sure what you're trying to do... is this on the front end? once the forms are saved to pages you can do anything you want with them, check the cheatsheet that pretty much has everything you need to know http://cheatsheet.processwire.com/
  14. <?php $entries = $pages->get("/submissions/")->children(); foreach ($entries as $entry) { ?> <p><?=$entry->name_1;?></p> <p><?=$entry->description_1;?></p> <? } ?> though in this case i think this is better: <?php $entries = $pages->get("/submissions/")->children(); foreach ($entries as $entry) { echo "<p>{$entry->name_1}</p>"; echo "<p>{$entry->description_1}</p>"; } ?>
  15. that's cool - didn't know you could request fc transactions via curl.. not sure why the code i posted didn't work for you though - i tested by re-feeding transactions from FC and was eventually able to have it reply with success and also it was successfully updating the processwire page (in my case decrementing the inventory)// did you include all of the scripts; // get these from http://modx.com/extras/package/foxycartinventory $rc4cryptPath = "/path/to/class.rc4crypt.php"; $xmlParserPath = "/path/to/class.xmlparser_php5.php"; i also have datafeed log working but commented out, since it's only needed for testing... anyway thanks for posting your solution, that could be useful at some point in the future...
  16. depends on where your opening php tag is, and this is not php comment <!-- use brackets then your editor can show you the matching bracket <?php foreach ($entries as $entry) { ?> <p><?=$entry->name_1;?></p> <p><?=$entry->description_1;?></p> <? } ?>
  17. i use this a lot: http://processwire.com/talk/topic/3429-how-to-set-text-linecharacter-limits-in-templates/?p=33779
  18. joss - you can basically do this by creating a text field and then use a tab field (FieldsetTabOpen); you could further enhance it by disabling editing of that field by permission
  19. @martijn - cool, yeah i've done some similar things like that, but your suggestion is really good for having all the settings for each slide layer in it's own little textarea; each slide is a page and then i could use a repeater for each slide layer and then have a text box for style attributes which control the animation... still doesn't really solve the putting of php directly into the editor though... i've seen plugins for other cms that enable one to put php into text area, one that i remember using a lot was sourcerer from nonumber.nl
  20. @martijn, renobird, matthew - here's a question - i have a site using layerslider which has tons of configuration options for each slide; it would be hard to provide those various settings as fields; i tried using Ace code editor for the client so they can make changes to the images and text, but in one of the slides i'm pulling data from processwire pages and need to use php... so i abandoned the idea of using the ace editor for now, but wondering if there is a way to do this currently in a simple way... maybe enable hanna code textformatter in the ace editor and then make a hanna code for the various things that need php...
  21. great - that's cool that this is working...!
  22. yes - that would work for the events themselves; but before you start foreaching through the month's events, if you wanted to for example output headers for each month, you could also use the existing $month variable and then strtotime it to get your month name, or use the switch..
  23. yeah - should probably do that - cheers! also - once you start setting up your markup for output, there are some things you can do to get the month names to output how you want (instead of numbers), usually done using php built in strtotime http://php.net/manual/en/function.strtotime.php , so you can pass the month as a string and then format it any way you want once you tell php that it's a date; http://www.php.net/manual/en/datetime.formats.date.php; since you are sorting by the month number, so those will appear in the right order; the last project i did i needed to customize the output of the day names, so i used a switch statement in the loop, something similar for this, in case you don't want to use the php date: <?php switch ($month) { case 01: $monthName = "January"; break; case 02: $monthName = "February"; break; // etc.. }
×
×
  • Create New...