Jump to content

statestreet

Members
  • Posts

    81
  • Joined

  • Last visited

Everything posted by statestreet

  1. That's just it, though. There's definitely an image! It's definitely a single-image field, and there's definitely an image there, because $tdobject->icon->url resolves to an image that loads in the browser (albeit only when logged in as admin, which must be a clue). I just can't call size() on it.
  2. Wow, this is ultra-classy. The layout is unconventional enough I thought it would be hard to navigate, but it wasn't! Also, the drinks section reminds me I never got around to trying Tannenzäpfle when I was in Germany a couple years ago, despite the recommendations. Still haven't found it in the states.
  3. I was pretty sure I had set the icon field to single-image only, but I gave the first() selector a try and instead got this: Error Call to a member function first() on a non-object I get the error about size() as well when I try slkwrm's broken-apart selectors. I must have overlooked something somewhere else that's affecting this in an unexpected way... any ideas where I should start looking? One new thing I noticed: While the $tdobject->icon->url does resolve to an image that displays in the browser, it only displays when I'm logged in as an admin. The path only renders to HTML when logged in; otherwise it's just <img src=""/>. Weird.
  4. In a template, I'm drawing a 4x3 table that I want to display images from other pages selected from page fields inside a repeater on this page. Their position relative to each other is important, and most of the space in the table will usually be intentionally empty, which is why I'm doing it in this rather strange way: In the admin, the referenced page's image's position in the table is chosen from page selects with columns and rows defined in /global/matrix/rows/ and /global/matrix/cols/. In the template, we get the images by iterating through the table and seeing if any of the "ingredient" items on this page match the the coordinates of the current table cell. If what I've described here sounds confusing, it's confusing me, too. Here's my loop: foreach ($pages->get("/global/matrix/rows/")->children as $row) { echo '<tr>'; foreach ($pages->get("/global/matrix/cols/")->children as $col) { $tdobject = $page->ingredients->find("m_row=$row, m_col=$col")->first()->ingredient; echo '<td><img src="'. $tdobject->icon->size(40, 40)->url . '"/></td>'; // line that throws the error } echo '</tr>'; } This gets me: Error Call to a member function size() on a non-object However, changing that line to this works: echo '<td><img src="'. $tdobject->icon->url . '"/></td>'; So I can pull a URL from the image object on the referenced page, but I can't call size() on it. What am I missing?
  5. Sorry I haven't shared this yet—I want to put this up on GitHub but I'm fairly new to Git in general, so it's taking me a bit longer than I anticipated. I think responsive could work for this. The only thing I don't like so much about responsive is handling images: I'd much prefer using PW's nice image rendering to crank out appropriately-sized versions instead of loading the whole thing and scaling it down in CSS, but maybe there's a way to do both, calling $image->size() twice and hiding/showing the appropriate one based on the viewport size.
  6. I don't know, modal windows sound messy too, but maybe that's just because I've been scarred by WordPress's cumbersome image insert boxes. Any way you go about it, you're probably looking at a somewhat less-than-ideal situation if you're adding a page with lots of fields while editing another page that references it. If it has enough fields that a user might forget to fill some of them out, it's probably worth going the long way around instead of trying to add it in-context.
  7. I wonder, could this use something akin to the fieldset-in-a-fieldset approach that repeaters now use? Perhaps it could even just replicate all the fields from the referenced template inside inside a fieldset in the page field, so while it might be best-suited to creating new pages with only one or two fields in their templates, it could expand to any template a page happened to use.
  8. Often, the pages I find myself referencing in a page field (whether through asmSelect or otherwise) are very simple. They might be categories, tags, or something along those lines, but they only contain a single text field. In cases like these, it would be great to be able to add new ones from the page that contains the referencing field. So if, for instance, I were adding a new page to a site, and had a "topics" field that selected pages from /topics/, and I realized that topic didn't exist yet, I could add it from the page without having to go back to the page tree, navigate to /topics/, create a new topics page, publish, then return to my unpublished new content page. I suppose the most straightforward plan of attack would be to create a new inputfield module, but ideally, this could be applied to any of the existing ones, whether checkboxes, asmSelect, or auto complete. Can a module extend other modules in that way?
  9. Quite the opposite, actually! That's one of the benefits of this approach—you set the divisions to, say, 8, then you can have one field that shows up five times in a row and is set to 1/8, then one field that shows up once and has the slider set to 3/8. Anyway, not to get hung up on this; I just like adaptively granular controls.
  10. That makes sense. That got me thinking, though (at the risk of overthinking ), how about a drop-down next to the slider that selects how many columns you want to divide into? 2/4 |========[]========| Columns: [ 4 ▼ ] So if you're doing 10 columns of integer fields, you can easily jump to 1/10th, and if you're doing something like sixths, you don't have to stop to mentally calculate what percentage one of those is.
  11. Columns are fantastic. One thought on the slider: I think there's much more precision than is needed in this context, i.e. the vast majority of people are going to set it to 25, 50, or 75%, so being able to set 51% is actually kind of annoying as you have to nudge it into the number you want. Maybe it could even just be 1, 2, 3, or 4 (it assumes a 4-column admin layout)?
  12. An idea for part two of the planets tutorial: Planet type could be a great place to introduce relational page fields. This might also help cement the idea of just what a page can be in ProcessWire.
  13. I was just thinking the other day that it would be great to have a fieldtype like this for when an integer field always falls within a predictable range. This is even better! One suggestion: How about having the number display editable, in case there is a specific number you need to enter (and there's a large range that might be difficult to hit with the slider)?
  14. As always seems to be the case when I use ProcessWire, this is going faster than I thought it would. I'm hoping to have an alpha version ready in the next few days, but here's a preview: The goal here is a versatile, one-stop theme that looks good enough right out of the box that people would be proud to use it as-is for their site (like some of the great premium WordPress themes like Khoi Vinh's Basic Maths or iA Japan's iA3, only free ), but also a site profile that does two things: Has a few "advanced features" that aren't so effortless with other popular CMSs such as footer pages and switchable image slots, and demonstrates that these features are built using nothing more than PW's field system and a few lines of PHP.
  15. Ah, that sounds great. I will go ahead with the page-based configuration I was originally planning, and whenever apeisa gets a chance to build a module along those lines, I can just convert the page to an admin page with it.
  16. Exactly. I think there's room for a profile that presents an elegant and usable site format for non-technical users, that people would want to use as-is, kind of like the classic Kubrick theme in WordPress. Maybe offer just enough customization to reduce the temptation to mangle it one way or another. I actually started on this this afternoon as I had some free time at work, and quickly realized I need to learn more about the admin system. Currently, I have fields for site name, tagline, and footer content. Originally, I had intended to just drop these fields into a page and set it to hidden, but—d'oh—of course, I could just create a new page in the admin. So I did that, but I'm not sure what to do with it next: do I need to select a process for it? How do I get those fields onto this new admin page?
  17. Interesting. How do you import or export profiles? Encouraging your average WordPress user to try ProcessWire for their next site is definitely one of the potential benefits of this idea. I wonder, though... If PW attained a certain level of popularity, would the profile format work as an off-the-shelf setup in the ThemeForest vein? Or is it too bespoke-oriented? Are the people who need a quick website and buy from ThemeForest better served by WordPress anyway? PW is such a powerful system that it feels like it's way more than your average quickie site admin needs, and yet it's almost easier to create a new page in PW than it is in WP (and honestly much easier than in Drupal). So it seems like there really is room to grow into the less-technical user market, at least from my perspective.
  18. Edited title to change "template" to "profile" Over the weekend, a friend showed me a temp site he'd set up for an academic project. He had spent all afternoon wrestling with Drupal to get a few pages up, and while I was quick to suggest that next time he try a more appropriate CMS for a five-page site, I wondered what the best suggestion would be. I suggested GetSimple because it's the simplest I've used, but that got me thinking about my favorite CMS: ProcessWire doesn't really have a true default template like you get with GetSimple, WordPress or Drupal, only an example site. It makes sense, as PW isn't really geared toward projects that would use a default site theme, but I wonder if there might be some benefit to having an "easy" site template that would let someone start a simple site with PW but grow into something much bigger if they ever needed to. I'm thinking I'd probably build the template with some hidden pages to configure parts of the template that are hard-coded in normal bespoke templates, such as the site title (or maybe an image upload) in the header, footer info, and so on. Does this sound like a good idea? Any suggestions? [edit] I really shouldn't be calling this a "template" because that term in PW refers to the individual page templates, and not the set of them. It's not really a theme, either, because it's also page content in the admin. Is this technically a site "profile" that I'm describing here?
  19. Ah, that's fantastic. ProcessWire keeps getting better the more I learn about it.
  20. Yeah, I think a nice set of h1-h5, p, ul, ol, strong, and em would be good for the future. In other words, what you get with TinyMCE in ProcessWire
  21. Nice layout! I'm curious, as your blog obviously has a large number of posts, do you find it gets messy dealing with all of those the PW admin UI? That's been my one worry so far with the admin (and specifically using PW for blogging), scaling to groups with large numbers of children.
  22. D'oh! The solution was right there in the error. [pre]$home->setOutputFormatting(true);[/pre]
  23. Indeed, I'd rather just use PW's API to render everything instead of SimpleXML. The only reason I'm using it really is so that we have a clean XML source to hand off to whoever ends up developing the mobile version of the site. When I try including the API, though, I get an exception: [pre]Uncaught exception 'WireException' with message 'Page /newsite/2012/ may not be rendered because outputFormatting is set to false. Call $page->setOutputFormatting(true) before rendering the page.' in /home/tonicblu/public_html/newsite/2012/sitecontent/wire/modules/PageRender.module:229 Stack trace: #0 /home/tonicblu/public_html/newsite/2012/sitecontent/wire/core/Wire.php(267): PageRender->___renderPage(Object(HookEvent)) #1 /home/tonicblu/public_html/newsite/2012/sitecontent/wire/core/Wire.php(229): Wire->runHooks(Array, Array) #2 [internal function]: Wire->__call('renderPage', Array) #3 /home/tonicblu/public_html/newsite/2012/sitecontent/wire/core/Wire.php(289): PageRender->renderPage('renderPage', Array) #4 /home/tonicblu/public_html/newsite/2012/sitecontent/wire/core/Wire.php(229): Wire->runHooks(Object(HookEvent)) #5 [internal function]: Wire->__call('render', Array) #6 /home/tonicblu/public_html/newsite/2012/index.php(20): Page->render('render', Array) #7 {main} thrown (line 229 of /home/tonicblu/public_html/newsite/2012/sitecontent/wire/modules/PageRender.module)[/pre] Weird.
  24. My latest ProcessWire project is converting a Flash (soon to be HTML5) site that is fed by a manually-edited XML file into one fed by a dynamically-generated XML file. Everything is going great with the XML generation; PW's markup-agnostic output is in top form here. I have a somewhat strange approach for this new site; it is simultaneously loading some content from the XML in PHP (for SEO), and then loading other content in JavaScript (for speed and flexibility). So it loads it once on the server and once on the client. However, I've run into a simple problem I can't seem to solve: I can load the home XML page in JS without problems, but when I try to load it in PHP: [pre]$xmldata = simplexml_load_file('sitecontent/');[/pre] The server says the file is empty. Any ideas? [edit] sitecontent/ is the ProcessWire root.
  25. statestreet

    Presteign

    I have just launched the new site for my music project (just in time for the new album release)! It's not a very big site, but it's all AJAX with a bit of unconventional CSS and JS to give it an unusual and distinctive layout. http://presteign.com
×
×
  • Create New...