Jump to content

thetuningspoon

Members
  • Posts

    691
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by thetuningspoon

  1. I'm using this gallery template file: http://processwire.c...__fromsearch__1 The CSS definitely isn't the problem, as I downloaded the image to check it out and it is, indeed, 900px wide (but looks like a 300px image blown up to 900px wide).
  2. I'm trying to set a max-width of 300px on the image field for images uploaded on the backend. However, when I try uploading a 900px wide image, I just get the image at the original width with greater pixelation. It's not being resized in the browser with html or css, since when I download the image it's still 900px wide. What's going on?
  3. Holy smokes, that was easy! I didn't even have to create a subdomain or edit a config file and ProcessWire still works without being in the root directory
  4. So the maintenance module has been great at keeping the site private while still allowing us to work on it in the background. Unfortunately, the issue I now have is that I want to show the site off to my client, but don't want to give them edit permissions. I tried creating a new user with just view permissions, but when I tried to log in with the new user, it threw the browser into an infinite redirect loop. Is there anything I can do to fix this, or is there another approach I could take? Thanks. EDIT: Even when I add edit permissions the loop still happens. EDIT 2: Oops, just read the plugin thread more carefully. Sounds like I'm looking for a feature that doesn't exist yet. Looks like I'll have to move my site into a subdirectory for now. I'm still not sure why I'm getting the looping, though. Might want to look into that, Pete.
  5. The maintenance mode module is exactly what I was looking for. Thanks!
  6. What's the best way to make a Processwire site temporarily invisible to the public? I'd like to be able to access the admin area and visit the site as an admin, but block pages from guests. I tried removing the view permissions for guests, but PW says this is a required permission.
  7. This is just what I was looking for. Thanks, rödgladan! However, I'm having an issue with the next and previous links. They're just showing as text instead of as actual links, and they don't do anything. Any ideas?
  8. I was thinking it would be good if it was something people could contribute to fairly easily. I'm sure that a lot of ProcessWire users here have accomplished a lot of really cool things inside of their templates using the API, and if there were a central place that they could then submit those for the benefit of others, that would save people having to re-invent the wheel or ask on the forums. Which leaves more time for Ryan and others to work on the core and various modules Some kind of basic gatekeeping/moderation would probably be necessary to ensure a minimum quality standard for the scripts.
  9. Not sure if this has already been suggested, but for the less php literate among us it would be great to have some sort of repository of php scripts on the PW website for formatting template data, i.e. the php snippets for outputting different kinds of menus, breadcrumbs, bloglists, etc. Similar to a database or list of modules, but specifically for the templating side of things, where you don't require a full-on module. Right now you have to scour the forums (or write your own code) if you're looking to do something beyond the basics that are included in the default templates.
  10. Got it, thanks. Is this in the documentation? Seems like something that should be a bit more visible. Got it working along with an "on" class for the active page: function listChildrenTree($children) { echo "<ul>"; foreach($children as $page) { $class = $page->id == wire('page')->rootParent->id ? " class='on'" : ''; echo "<li><a href='{$page->url}' $class>"; if($page->id == wire('pages')->get("/")->id) echo "<img src='" . wire('config')->urls->templates . "styles/images/home.png' width='24' height='28' alt='' />"; echo "{$page->title}</a> "; if($page->numChildren && $page->id != wire('pages')->get("/")->id) listChildrenTree($page->children); echo "</li>"; } echo "</ul>"; } $children = $pages->get("/")->children(); $children->prepend($pages->get("/")); listChildrenTree($children); I tried passing the home page to the function as a parameter and using that instead of wire('pages')->get("/")->id but any time I tried to add a second parameter to the function the script errored. Any idea why this would be?
  11. Thanks. I was just looking at the Include & Bootstrap portion of the documentation. Is $wire->$pages->get("/")->id also an option? Seems a bit simpler to me. Neither of them seem to be working for me at the moment, but I'll keep working on it.
  12. Thanks, apeisa. I can't seem to get it to work in my example. Can you show me more specifically how this would be implemented? for example, to get the id of the home page: $pages->get("/")->id How would I write this in a function? Wrap the whole thing?
  13. I need to accomplish the same thing as Julian, but with the Home page tacked onto it (with an image inside the <li>, which you helped me out with before). I tried figuring this out on my own (I really did!): function listChildrenTree($children) { echo "<ul>"; foreach($children as $page) { echo "<li><a href='{$page->url}'>"; if($page->id == $pages->get("/")->id) echo "<img src='" . $config->urls->templates . "styles/images/home.png' width='24' height='28' alt='' />"; echo "{$page->title}</a> "; if($page->numChildren) listChildrenTree($page->children); echo "</li>"; } echo "</ul>"; } $homepage = $pages->get("/"); $children = $homepage->children("limit=6"); $children->prepend($homepage); listChildrenTree($children); But it seems to be choking whenever I try to use $pages or $config inside of the function. Is it not possible to access the API variables from within a function? If so, what's the best practice here? I must be missing something obvious!
  14. I found ProcessWire through a Google search for "CMS with custom fields." It was the #1 result. I too visited the ProcessWire site once, briefly skimmed the page, and didn't think much of it until I stumbled upon it again a week or so later. At the time I was trying to sort through 20+ CMSs at the same time, dealing with being let down by my exploration of Drupal, and the first impression that PW gave me was also that it was probably a "heavy developer CMS." I would have to say that the images of skyscrapers and the city skyline contributed to this first impression. The ProcessWire site and default admin interface is very clean and professional, but it does come across as somewhat "corporate." Not quite as "web 2.0" (or 3.0, or whatever number we're on now) as some of the other CMS sites out there (PyroCMS, for example). My impression was that PW was probably a powerful CMS, but not one that would excel on the usability front, would be easy to get started with, or that would be concerned with things like web standards, HTML5, or what have you. Of course, all of that was wrong, as I quickly discovered after putting 20-30min into researching it and exploring the site materials. But being very visual and design-oriented, that's how it came across to me at first glance. Hopefully that's helpful. The other thing I did at the time was a search for PW on opensourcecms.com, which turned up nothing. This gave me the impression that PW wasn't very popular and probably didn't have the support I was looking for.
  15. Yeah, I realize that if I want the main menu display to be the default, I could just change the label to "Don't display in main menu" and change the code in the template to correspond. But if I have a list of a bunch of different menus and some of them are stated as "dont's" and some as "do's," that could start to get confusing for the editor. Fair enough, though. I didn't think of it from the technical side. For now, that will do fine.
  16. Perfect! Thanks, Ryan. Obviously I need to spend some more time learning the API.
  17. What is the best way to add an image to one of my navigation links? I would like to add an image tag right before my homepage link, within the anchor tags. Starting from the default navigation code: $homepage = $pages->get("/"); $children = $homepage->children; $children->prepend($homepage); foreach($children as $child) { $class = $child === $page->rootParent ? " class='on'" : ''; echo "<li><a$class href='{$child->url}'>{$child->title}</a></li>"; } I tried editing the $homepage variable to concatenate an image tag before $pages->get("/"); but that threw an error since (I'm guessing) the prepend() method is specific about the kind of input it will take in its parameter. I'm probably going about this all wrong. Any help would be greatly appreciated.
  18. Well, the main goal of my suggestion to divide up the tree was to make it easier for both the developer and the client to achieve the desired output, not just the for the visual effect on the back end. I see either of these approaches (using categorization or adding checkbox fields in the templates / hard coding) as being viable solutions, depending on the circumstance and the type of website being built. So I really don't have an issue with it, and I don't think Ryan should necessarily change it, unless there's a good practical reason which fits with the logical structure of the rest of the application. I didn't realize that the main issue you guys had with my suggestion was with the names I used and not so much with the concept I go into more detail on that in my previous edit above. I'm still wondering about this, though:
  19. Personally, I think that a well constructed content structure should make for a good navigational structure and vice versa. Separating them results in bizarre situations like you have in Joomla where articles can be categorized but it has no practical effect on how the site handles the content on the front end. This, in my experience, results in a difficult mental model that frustrates clients to no end. So It seems to me that PW has been developed to eliminate that sort of confusion. When you output your navigation onto the page, you basically spit out the content structure, with maybe some minor adjustments or repetitions here and there, but you're not picking and choosing pages one-by-one and forming a completely different navigational structure. I see this as a strength of PW. And PW makes it very easy to reorganize your content structure, so I don't see that as a concern. I would be really interested to hear Ryan's take on this. Edit: I do understand what you guys are saying--that the separation of navigational elements doesn't necessarily correlate with a difference in the underlying content structure. That being said, if your navigation is well thought out, the links in these navigation sections should have something in common with each other that makes them fit to be together. In other words, something about their content should dictate their placement and grouping. So while my previous example fails in that I use a physical page location as my parent item, I could just as easily group these items like so: Home Cars Page 1 Page 2 Page 3 Boats Page 1 Page 2 Page 3 404 Trash And have the children of Cars show up in my main nav with the children of Boats in the footer. In this case, having /cars/ or /boats/ in my URL structure would not be so bad, because it is describing the content.
  20. Hmm... what should it reflect then? I thought that was the whole idea of keeping the menu structure and content together, as opposed to CMSs like Joomla and Drupal which require you to link your content with a separate menu item either during its creation or after. Edit: If you do go the checkbox input field route, is it possible to give the checkbox a default value? For example, have a Main Menu checkbox that is checked by default and a Footer Menu checkbox which is unchecked by default? Ideally, I'd rather my clients not have to go through an extra step to get their content to appear.
  21. Ah... thanks! I was looking for it in the header (doh!) That's so wonderfully simple.
  22. When I said "Is there any way around that" I was specifically referring to avoiding having the parent name added to the URL structure. Your solution is a good one as well, but it seems like it would be simpler, easier to visualize, and more scalable to just be able to divide up your menu structure. Then you could easily implement as many menus as you want.
×
×
  • Create New...