Jump to content

digitex

Members
  • Posts

    231
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by digitex

  1. Well, you're right, I don't get it. I'm learning though. Thanks for pointing that out. You have to admit, your post above was a bit on the cryptic side for someone who's not fluent like me. I get it now though. Thanks for everyone's efforts. It was another learning experience at least.
  2. Well, if a conference doesn't happen, for whatever reason, a get together is still a nice idea even on a smaller scale. Pick a park, get some potato salad, I'll bring the hot dogs and beer.
  3. OK. I'm not following you though. It still doesn't display the image. I was just pointing out that the selector seems to be ok since one displays the image name but not the url and the other displays the url but not the image. I have used that exact code on another site and it works but not here. If I only have 1 image in the repeater I shouldn't need to use first() and I don't on the other site, and it works, but not here. it doesn't seem like what I've got is wrong unless I've missed something, it's just not working.
  4. No image displays regardless of how many images are posted. There's 2 allowed in the maximum files allowed so in this part: if (count ($item->product_shot) > 1) { echo "<div class='productcontainer'><div class='prodpic'><a class='nowandthen'><img src='{$item->product_shot->url}' alt='{$item->product_shot->description}'> <img src='{$item->product_shot->url}' alt='{$item->product_shot->description}'></a></div>\n<div class='prodtext'><h2>{$item->product_name}</h2>\n{$item->product_description}</div></div>"; } It displays 2 images as part of a CSS3 hover effect that replaces one image with another during mouseover but even if I remove that part of the code and just keep: echo "<div class='productcontainer'><div class='prodpic'><img src='{$item->product_shot->url}' alt='{$item->product_shot->description}'></div> \n<div class='prodtext'><h2>{$item->product_name}</h2>\n{$item->product_description}</div></div>\n"; It still doesn't display any image even when only one image is posted. I need to get at least one image to appear before I solve the problem of multiple images. I will use the $item->product_shot->first()->url when I get to that point though. Thanks. When I use ($item->product_shot} strangely it returns the names of the images (both images) without the URL but when I use {$item->product_shot->url} it returns the URL but without the image names.
  5. The repeater is still twitchy for me. I have a site where they sell buttons, and I need to be able to associate a name, description and image to each button. The repeatable field is perfect for that since there's only about 5 different buttons but I can't get the images to display. foreach($page->get("product") as $item) { if (count ($item->product_shot) > 1) { echo "<div class='productcontainer'><div class='prodpic'><a class='nowandthen'><img src='{$item->product_shot->url}' alt='{$item->product_shot->description}'> <img src='{$item->product_shot->url}' alt='{$item->product_shot->description}'></a></div>\n<div class='prodtext'><h2>{$item->product_name}</h2>\n{$item->product_description}</div></div>"; } else { echo "<div class='productcontainer'><div class='prodpic'><img src='{$item->product_shot->url}' alt='{$item->product_shot->description}'></div> \n<div class='prodtext'><h2>{$item->product_name}</h2>\n{$item->product_description}</div></div>\n"; } } I get <img src='/pw/site/assets/files/1010/' alt=''> in the markup while the name and description displays correctly. I have almost the same set up in my own photography site for the galley where I have a name field and description associated with each image and it works (although I don't remember how I got it to work because it didn't at first either). is my selector wrong? "Product" is the repeater.
  6. Is there any word on this? A preview without save would be ideal. Currently, the view page doesn't open in a new window and doesn't reflect changes without saving first, which puts potential errors out there for the world to see. Worse, if you don't save first, by the time you realise your edits are not showing, you've lost them all since it doesn't open a new window. I'd like to see about adding a target="_blank" to the view button in the interim but preview would be far better. If it can be made to work fairly consistently across all browsers. If you're still working on this Nico, thanks for the effort and keep it up.
  7. Seconded. I would want to attend but probably couldn't in UK. Someplace closer to the Ontario/U.S. border would be doable though. Great idea wherever it's held.
  8. That's the ticket. Thanks Ryan. You've probably written the equivalent of a Steven King novel by now just answering the questions of people like me. I hope you never get tired of it. It's appreciated.
  9. Soma you are a genius. I removed the value attribute and inserted checked="checked" and voila. The checkbox retains the changes I make. I still have to logout and log back in to see the updated status but that's a different issue. Just to keep the problem unclouded I removed that part from my previous post. Thanks for the help. I'm almost there.
  10. You were right Ryan. I tried the "continue" inside the foreach at first but it didn't seem to work. The error I reported was from my desperate attempt to make it work by moving it. I discovered today that it did work just as you instructed but I didn't realize it. With the code as it is now, when I click submit it reloads the page and the entire form goes blank. But If I log out and log back in it displays the changes correctly. So it's working but you can't tell unless you logout and back in which woould be confusing for users. Maybe I need to redirect upon submission to a new page like a thank you page so that when the user returns to the edit page it displays their edits correctly.
  11. Thanks for the help Ryan. 1. No need to fix anything. I didn't realize those field names were reserved but I'm not using them anyway. I edited the code to make the field names more descriptive and easier to read. probably didn't need to bother but being a novice, I find it easier when the fields are english words that tell me what they mean. My bad. 2. I added: if(!$input->post->submit) continue; and it gave me an error when I hit submit: So I altered it to: <?php if($input->post->submit) { echo "<p>thank you. Your edits have been saved.</p>"; } else { echo "<form action='./' method='post'>"; $hafhmember = $pages->find("template=editable_page, include=hidden"); foreach($hafhmember as $h) { etc etc etc And the error goes away, the existing data is retained and hitting submit returns the thank you message but the edits still don't save. 3. Done. Thanks, good advice. It doesn't solve the problem but will certainly avoids a new problem because there will definitely be more than one item. 4 & 5. Have not bothered with sanitizing anything yet but will once it manages to save. Do you have any other suggestions? Should I post the entire unaltered page instead of just the form? There's not much else there but there may be something else I've done wrong that I don't see.
  12. Hi Ryan, I'm sorry it took me so long to get back to this. I was called away. I spent some time trying to figure out the formtopage you posted as well and couldn't. Coming back to this thread I see am in a similar boat to at least one other person. My form is one of my creation as well so I guess the formtopage isn't for me either. This is what I have. I didn't include the sanitizer. Is that the problem? Am I a complete knucklehead? Is it a simple thing to get working or have I corked it up royally? <form action='./' method='post'> <?php $hafhmember = $pages->find("template=editable_page, include=hidden"); foreach($hafhmember as $h) { if (count ($hafhmember) > 1) { echo "<h2>$h->title</h2>"; } echo "<table>"; foreach ($h->rp as $r) { echo "<tr><td><input id='start' type='text' size='30' value='{$r->start}' name='start' /> to <input id='end' type='text' size='30' value='{$r->end}' name='end' /></td> <td>$ <input id='cost' type='text' size='30' value='{$r->cost}' name='cost' /></td> <td>$ <input id='down' type='text' size='30' value='{$r->down}' name='down' /></td>"; if ($r->purchased) echo "<td><input id='purchased' type='checkbox' size='30' value='1' name='purchased' checked /></td>"; else echo "<td><input id='purchased' type='checkbox' size='30' value='0' name='purchased'</td>"; echo "</tr>\n"; $r->setOutputFormatting(false); $r->start = $input->post->start; $r->end = $input->post->end; $r->cost = $input->post->cost; $r->down = $input->post->down; $r->purchased = $input->post->purchased; $r->save(); $r->setOutputFormatting(true); } echo "</table>\n"; } echo "<input type='submit' value='Save' name='submit' />"; ?> </form>
  13. Thanks Ryan. Sorry I didn't get back to you sooner. I've spent the last 3 days getting my own site up so i haven't had a chance to look at what you posted. Once I wrap my meager lobes around it I'll let you know how I made out. BTW yes it's all the fields. I expect that you're right about it not connecting the values to the proper fields. I'll report back.
  14. Hi Ryan, thanks for the reply. It is a trusted user environment in that members don't register themselves, their membership status has to be set up by an admin, (most likely me) and it's monitored. The site owner actually speaks to and often meets the members beforehand so the scenario you describe isn't likely. However, having the option to add/delete repeater items falls into the "wouldn't that be a nice feature" category rather than a necessary one. I'm most concerned right now in providing an editable form where members can alter data and save. So far I have been able to make the edit page display the repeater field contents in a form but it doesn't save. I have cobbled this together by reading other threads which were not specifically related to what I need so I'm stuck.
  15. Is there a walk through or tutorial on how to allow a user to update data to an existing page using a form? I have a members area (password protected) in which data displays from the members own page. The data is from a repeater field since each entry has related fields asociated with that entry, (seemed the easiest approach). I need them to be able to log into the member page and access their content via a form that they can edit and save. I'd also love for them to be able to add/delete the repeatable fields in a similar way as you can in the admin. Has this been addressed before? I wouldn't know how to begin. I've read many similar posts regarding adding new pages by way of a form but not with repeatable fields and editing existing data. I've learned so much from this forum about PHP and working with PW but I still have no idea how to approach this.
  16. THANK YOU SOMA! I thought it must be easier than I was making it and that something was just a little off on what I was doing. I had pretty much what you have (you showed me a few ways to simplify things) but it wasn't working. With your example to go by as correct, I figured there was something else wrong so I looked at my selector and found my problem. Now all I need to do is glue the hair I pulled out trying to get this, back on my head. Thanks again.
  17. This is interesting. I have been using the repeatable field for a little while and it's a huge benefit. I'm stuck though. I have several pages with a repeater field and I want to display the fields, organized by page: <h2>Page Title</h2> <ul> <li>repeatable field info</li> <li>repeatable field info</li> <li>repeatable field info</li> <li>repeatable field info</li> <li>repeatable field info</li> </ul> <h2>Page Title</h2> <ul> <li>repeatable field info</li> <li>repeatable field info</li> <li>repeatable field info</li> <li>repeatable field info</li> <li>repeatable field info</li> </ul> <h2>Page Title</h2> <ul> <li>repeatable field info</li> <li>repeatable field info</li> <li>repeatable field info</li> <li>repeatable field info</li> <li>repeatable field info</li> </ul> Like so. The array that Soma and diogo wrote seems like the ticket but does that just return the contents of the array as one big list or can it be organized by page? I have no idea how you'd do that.
  18. Thanks for the reply Alan and for going to the trouble to try to replicate the problem. I created 3 pages and only one gave me the 404 error, the other two, handled in the same way, were no problem. If I knew it was just a weird glitch that might not ever happen again I would be cool with it but if it's perhaps a database issue that might lead to a corruption in the db then I'd start sweating a little. I have downloaded the latest version and was planning to upgrade and since I don't really need to save and leave unpublished I just won't do that. Here's hoping I never see that again.
  19. Hi Ryan and the processwire crew. I had an interesting error come up today. I did up some new pages for a client, saved but left unpublished and later, tried to set the page status to published but hidden so the client could see it before it went live. When I hit the save button it returned a 404 page not found error. I tried several more times, logging out and then back in and even deleted the page and created a new one. It kept returning 404. I finally had to use PHPmyAdmin to make the changes manually. Has that error been documented? I'm trying to determine if it's a database problem on my end or some obscure bug that just popped up today. I have to admit this is the first time I've done up a page and left it unpublished. Using pw2.1
  20. You're right. I couldn't get my head around it. Seemed overly complicated for what I needed. probably not if I'd looked at it from the start and taken the time to do it "properly". I'll have to explore it more. Processwire's being developed so fast that even if you have the latest of everything when you start a project, by the time you get half way finished there are new features ready that would have made your job easier. I tackle problems as they come up so when it did I looked for the simplest solution and this module seemed like it. It would be nice to see it developed further to have the power and flexibility of the Page-field approach with the ease of implementation this module allows. That's just the opinion of someone who's PHP skills hover around the "me Tarzan you $page" level.
  21. Thanks Apeisa under ordinary circumstances I think you'd be right. I deal with clients who need me to set up their email, some don't even know how to check email. What's a URL? What is a domain name and how is it different from hosting? etc. etc. Things need to be verrrry simple, which is what I like about this module. All pages associated with an edition of the magazine go inside a parent directory for that issue. Sections are determined by an easy drop down selection. Asking the future site editor to create hidden pages for sections will result in me spending hours on the phone walking them through what a hidden page is and how to make it. I got this module to work. It displays article links under the right section heading just like a dream. My only problem now is that headings display even when there are no articles in the section. if I use $articles = $page->children; $features = $articles->find("magazine_section=A"); if ($features) echo "<h2>Feature Articles</h2>\n<ul>"; foreach($features as $feature) { echo "<li><a href='{$feature->url}'>{$feature->article_title}</a></li>\n"; } echo "</ul>\n"; It displays articles correctly but shows the heading even if no articles exist. If I use $articles = $page->children; $features = $articles->get("magazine_section=A"); if ($features) echo "<h2>Feature Articles</h2>\n<ul>"; foreach($features as $feature) { echo "<li><a href='{$feature->url}'>{$feature->article_title}</a></li>\n"; } echo "</ul>\n"; It hides the heading if no articles are present for that section but if there are articles all it displays is a list of bullets, no links. My code could be completely wrong but it's close so i have hope that this module will work.
  22. OK I'm still having a problem with this. I can get the articles to display BUT if there is no article associated with a section (determined by the drop down menu) I don't want the heading to appear in the markup. I can't get that to work. To illustrate lets say I have 3 sections defined in the drop down: 1:=Feature article 2:=Health 3:=lighter side in this month's edition of the magazine I have 3 feature articles, 0 health articles and 1 lighter side article. In the markup on the site I have headings <h2> for each section but if there is no article for a particular section I don't want that heading to appear so for this month there would be a heading for feature article with 3 articles listed under it, and a heading for lighter side with 1 article listed. Health won't appear because there is no article this month. Next month there may be one so at that point the heading will appear above the article in that section. Right now I can get the articles to appear in each section but even if there is no article in Health, the heading shows up, I assume because the section exists in the drop down. Can I get around that? I have been wracking my brain over this for a couple of hours, gave up, had a couple of drinks and then returned to it. If none of this makes sense, the drinks may be why.
  23. I think I answered my own question. I installed the module and tweaked it with Ryan's fix to get the value to save. I haven't been able to get it to display the articles in the proper order but that's just because I have no idea what I'm doing. It does look like it will work though.
  24. I'm currently working on an online magazine for a site and I have to provide an interface an editor can use to publish new issues. I had hoped i could make it simple and allow all the articles to reside loose in the issue folder: Magazine April 2012 Article 1 Article 2 Article 3 etc. And organize the presentation by having a drop down menu in the magazine page template to allow the editor to select a section : 1-Feature 2-Health 3-lighter side Then in the table of contents I could list all articles in sections: Feature articles, health articles and so on. Would this module do the job or is this meant to be used by site visitors?
  25. Thanks Ryan. The only downside to this is it counts all comments including the ones waiting for moderation. The number may not always agree with what's being displayed. Not an issue though. Didn't even see that until you pointed it out. My search skills are wanting it seems. Thanks. I did the pre-populate and hide option.
×
×
  • Create New...