-
Posts
377 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Craig
-
It would depend on a few things, but I think the main things to consider are: How often the data needs to be updated. If you want to query on it. If you want to display it on different pages. How unique the data is. One or more of those things may be important and could sway the decision one way or another. For the specific example of customers and transactions, I would probably lean towards storing the information in ProcessWire pages, and using hooks to update it if needed. Another thing to think about is potentially using MarkupCache to cache calls to the API. I use this on one site that uses a service for post code to location conversion. Another website we manage (in PyroCMS) is a front-end to a much larger information system, and the data required for that website is just pulled out and updated daily. It uses some SQL to achieve that, and it'd be easier to do it in ProcessWire, but just another example
-
Ah! Excellent, thanks. Didn't see that tucked away in there
-
Just noticed a small issue with the sidebar menus on the ProcessWire website (in Chrome) - see attached! It occurs when moving the cursor away from a hovered item. It looks like background-repeat just needs setting to "no-repeat" on the anchor tags CSS .subnav li a.
-
Why does $session->login() require $session->redirect()?
Craig replied to thetuningspoon's topic in API & Templates
To build on top of Ryan's response, redirecting is not just sensible to do on login, but whenever you have forms. The wikipedia page on the Post/Redirect/Get pattern explains it much better than what I can - it's definitely worth the read -
The Holy Grail would be to surface the complexity options in the module configuration page for the Inputfield or Fieldtype
-
selector questions about pages with datetime field
Craig replied to PeterDK's topic in Getting Started
Almost! You would just need to alter the end date selector to be like this: events.date<=2014-12-31 I'm not 100% sure about this, but you may have to extend the datetime inputfield to get this functionality. Perhaps you could do this by adding a new DB column for day_number/day_name, which is calculated and updated on save, to allow you to query on it. You can select by days using native MySQL date-related functions, and this would probably involve customising the getMatchQuery function of the inputfield. Ryan might know better about this one -
Repeaters within repeaters, and the pageFields inside them.
Craig replied to darrenc's topic in General Support
Another option I can see is to create the rental seasons as child pages of the house, and in each of those pages have a simple repeater field where you set the rate types and values. If you're feeling up to it, you could even create your own fieldtype and inputfield combination for all of those - instead of using repeaters. Ryan put together a great example that could get you started - Events FieldType and InputField. -
Sounds sensible to me
-
ProCache module? I'm also using Vidahost (affiliate link) Cloud hosting personally and at work, which I think might help in this situation. Their platform serves websites via many load-balanced web servers and have separate MySQL boxes, rather than a single server doing everything.
-
That's a very beautiful site. Well done!
-
I would create each one of those attributes as a Page, and use a Page reference field (multiple) to store them (perhaps named "boden"?). In the admin interface, this could be represented by multiple checkboxes, or AsmSelect (for example). So you would create Pages for all of those (FLIESEN, STEIN, TEPPICH ...) under a certain parent, first. Once you have that list, you can leave it alone. Then for each item that references those as a 1, you just add the relevant page to your "boden" field.
-
Hey Mel I've highlighted two bits above in bold - is it right that you have those two problems? The last one should be quite easy. ... $count = count($entries); if($count > 0) { echo "<p><a class='article-list__link' href='$url'>$date <b>(" . $count . ")</b></a></p>"; // output the month and count echo "<p><ul>"; foreach ($entries as $entry) { echo "<li>"; echo "<a href='$entry->url'>$entry->title</a>"; echo "<p>$entry->summary</p>"; echo "</li>"; } echo "</ul></p>"; } What that does is just loop through the $entries PageArray. Each $entry is a page, so you can access all of its fields. You can change the HTML and field references to suit your pages. You say clicking on the /news/year/month/ URLs is showing all blog posts, and not those in the year and month. I presume the template file for the template of the /news/ page has some code in it that pulls out your blog posts? You didn't mention any more details or code relating to this bit, so I'm guessing a bit now - but here are some things to check. The template of the /news/ page. In the CMS, go to edit the Template of this page. The "Allow URL Segments" option should be ticked in the URLs tab. In the template file for that template, you should be able to use $input->urlSegment(1) to retrieve the year and $input->urlSegment(2) for the month. Something like this in that template should get you started: // Get year and month from URL $year = $input->urlSegment(1); $month = $input->urlSegment(2); if ($year && $month) { // Both year and month $startTime = strtotime(date("$year-$month-01")); $endTime = strtotime(date("$year-$month-31")); // Your /blog/ page $channel = wire('pages')->get('/blog/'); $entries = $channel->find("date>=$startTime, date<=$endTime"); // or substitute your own date field $count = count($entries); if($count > 0) { echo "<p><ul>"; foreach ($entries as $entry) { echo "<li>"; echo "<a href='$entry->url'>$entry->title</a>"; echo "<p>$entry->summary</p>"; echo "</li>"; } echo "</ul></p>"; } else { echo "<p>No posts found.</p>"; } }
-
Forget apps. There's a module for that
- 1 reply
-
- 1
-
I would definitely recommend reading through the commentary and code in the CMSCritic and SignificatoJournal case studies. They have a lot of useful guides and tips on how to approach importing data into ProcessWire. Firstly, though, I think you are right to analyse the XML data that you have. I would approach it like this: Identify the attributes/fields that you are interested in, and the different types of content (if more than one). Determine which types of fields those should be in PW. Set up the fields and templates in PW. Set up a page structure in PW that will hold your content, using the templates you created. Start writing & testing the import! Create a new php file and bootstrap PW, or create a temporary template (with file) and page, and write it in that. Or, as mentioned above, if CSV format is an option - then give that a go.
-
Awesome! You have your own IMDb entry as well... !
-
Whenever I see or hear sass --watch, I immediately think of Sasquatch - as in the alternative name for Bigfoot I don't do much with preprocessors at the moment, but I use Koala for watching and processing if I do.
-
I think you have to create a new application. This might help - https://dev.twitter.com/docs/auth/tokens-devtwittercom
-
The All-in-One Minify module is great for combining and minifying both CSS and JS
-
This is the one, I think
-
I mainly use the Elegance admin theme, which includes a "Site" link. I missed this in the new admin theme too - so just add this code in the template: <li><a href="<?php echo $config->urls->root ?>"><i class="icon-globe"></i></a></li> Which produces the result attached (globe icon next to user profile one). Nice and simple
-
Each role object has some additional functions to help with checking, adding and removing permissions: // Add $role->addPermission("page-edit"); // Remove $role->removePermission("page-edit"); // Don't forget to save $role->save(); The parameter (here, "page-edit"), can be a permission ID, name, or instance of a permission (i.e. doing $permissions ->get() or ->find()) This was taken from the reference on the cheatsheet - $roles - click [+].
-
Looks great! What really comes through is the professionalism and dedication - I can just tell that they do a good job.
-
Nice! The design really does the photos justice. I like how they're displayed in the list, as well as fullscreen.
-
Been there, done that! Time to have another cup of coffee...