-
Posts
13 -
Joined
-
Last visited
Everything posted by anowitz
-
Can you have a repeater field within a repeater?
anowitz replied to Brian Larson's topic in General Support
Thanks so much, @kongondo! I'll be sure to take a look. -
Can you have a repeater field within a repeater?
anowitz replied to Brian Larson's topic in General Support
Thanks so much for getting back to me, Ryan! Your proposed solution makes a lot of sense (I love how simple and elegant it is) - I'm going to give it a shot and see how it goes! -
Can you have a repeater field within a repeater?
anowitz replied to Brian Larson's topic in General Support
Hello Ryan and others! I've got a situation in which I'm hankering to use nested repeaters, and would love anybody's thoughts about alternatives that make sense. I'm creating a website that needs to display artist CVs with very strict formatting guidelines. The HTML I'll be outputting will look something like this: <div class="section_wrap"> <div class="section_header">One-Person and Collaborative Exhibitions</div> <div class="section_body"> <div class="year_wrap"> <div class="year">2012</div> <div class="year_entry_wrap"> <div class="year_entry">Item 1</div> <div class="year_entry">Item 2</div> </div><!--/year_entry_wrap--> </div><!--/year_wrap--> <div class="year_wrap"> <div class="year">2011</div> <div class="year_entry_wrap"> <div class="year_entry">Item 1</div> </div><!--/year_entry_wrap--> </div><!--/year_wrap--> </div><!--section_body--> </div><!--/section_wrap--> <div class="section_wrap"> <div class="section_header">Group shows</div> <!--and so on--> The nested repeaters I would use if I could would work out something like this: "section" (fieldtype:repeater) "section_header" (feldtype:text) "year_wrap" (fieldtype:repeater) "year" (fieldtype:text) "year_items" (fieldtype:text) That way, I could have a template called CV with the field "section" in it, and each CV could be entered as one page, with a page tree structure like this: Home CVs Artist 1 Artist 2 Etc... The workaround solution I'm thinking about now (though I'm sure there is something better) is to have each section be a different page: Home CVs Artist 1 Section 1 Section 2 Etc Artist 2 Section 1 Section 2 Etc Etc I'm still relatively new to PW and PHP, so if the answer is apologies if this seems like a silly question. I'm getting close to finishing my first major project with PW and have absolutely loved it, both for the framework itself and for the amazing community. Thanks in advance! -
images uploaded via script not showing up in admin
anowitz replied to anowitz's topic in API & Templates
Good to know - thanks! -
images uploaded via script not showing up in admin
anowitz replied to anowitz's topic in API & Templates
Problem solved (another premature post - my apologies). For the record, I needed to add these lines to the code: $page->setOutputFormatting(false); $page->save(); -
I've just started working on a custom script that will allow me to migrate images from my client's old site to my new PW site. (The pages the images are going to be added to already exist on the new PW site.) I am able to successfully add images using $page->images->add, but when I edit the page I've added the image to in admin, the image doesn't show up in my images field. I'm relatively new to the API and assume I must be missing some basic piece here, maybe something have to do with Pageimage or OutputFormatting? Any help is very much appreciated! Here is the very preliminary code I'm using to test this out: //these variables will eventually be arrays I'll iterate over... $page_id = 'page id'; $description = 'image description'; $image_path = 'image url from old site'; //add image and image description $page = wire("pages")->get($page_id); $page->images->add('$image_path'); $page->images->last()->description = $description;
-
Problem now solved! I should have used the site profile exporter module from the start - I started fresh with it, and it did the trick without any problems at all (though I did make sure to change htaccess.txt to .htaccess before I ran the installer.) Thanks for the great module, Ryan!
- 4 replies
-
- 2
-
- dev site
- apache mod_rewrite
-
(and 2 more)
Tagged with:
-
I apologize - I think I wrote this post prematurely. Still working on the problem, but don't think it has anything to do with mod_rewrite so am marking post as solved...
- 4 replies
-
- dev site
- apache mod_rewrite
-
(and 2 more)
Tagged with:
-
Oops! Thanks for the tip - changed it now - just thought it would help! In fact, I am now seeing this in the php info "_ENV["HTTP_MOD_REWRITE"] On" So perhaps this is a different problem altogether...
- 4 replies
-
- dev site
- apache mod_rewrite
-
(and 2 more)
Tagged with:
-
I'm moving a PW site from a local environment to a dev site for a client hosted by register.com. I've followed Ryan's directions here (thanks, Ryan - very clear and helpful!) and am getting an "internal server error" when I go to the root (found here) and am also getting this error when I try to access the admin page: "Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/0.9.8e-fips-rhel5 DAV/2mod_auth_passthrough/2.1 mod_bwlimited/1.4FrontPage/5.0.2.2635 Server at dev.callicoonfinearts.com Port 80" I created a test.php file that executes phpinfo, among other things (test.php file can be found here.) From what I can gather, mod_rewrite is not currently enabled. I uncommented the "RewriteBase" line in .htacess so that it reads RewriteBase /process/ and have tried placing the .htacess file in both my dev folder and in the site's public_html folder. When none of these worked, I called register.com and was advised to enable mod_rewrite through a php.ini file that I should place in the public_html folder. My question is - is it possible to enable mod_rewrite using a php.ini file? (All the research I've done seems to .htaccess or httpd.conf as places where mod_rewrite should be enabled - some comments I've read have specifically said that because mod_rewrite is an apache module it has nothing to do with php or a php.ini file.) Was I misinformed by the person at register.com, or am I missing something? Thanks!! Many frustrating hours spent on this already....
- 4 replies
-
- dev site
- apache mod_rewrite
-
(and 2 more)
Tagged with:
-
using wire("pages")->find with "|" operator and multiple selectors
anowitz replied to anowitz's topic in API & Templates
Looks like that worked - at least with the limited number of pages I've got in the dev site right now. Thanks so much! -
using wire("pages")->find with "|" operator and multiple selectors
anowitz replied to anowitz's topic in API & Templates
Thanks for the quick reply Adrian. I'm trying to replicate "or." If I understand selectors correctly, doing "press_exhibition=$exhibition_id, news_exhibition=$exhibition_id, press_artist=$exhibition_artist, news_artist=$exhibition_artist" would replicate "and" - is that right? Is there a way to replicate "or"? -
I'm building my first site with PW and am absolutely loving it. I've spent a lot of time reading the forums--fantastic community!--but can't seem to find the answer to my question....so here goes. I'm building a website for an art gallery and would like to have a section on the "exhibitions" page called "related news and press." The page hierarchy looks something like this "exhibitions-parent" (not visible) --"picasso exhibit" "news-parent" (not visible) --"Picasso exhibit opens!" --"New book about Picasso's life and times released" "press-parent" (not visible) --"Review of Picasso exhibit in the NYTimes" Children of "news-parent" use the template "news," which contains two relational page fields called "news_artist" and "news_exhibition" Children of "press-parent" use the tamplate "perss," which contains two relational page fields called "press_artist" and "press_exhibition" In my "related news and press" section I'd like to output all news or press items that are linked to either the exhibit or the artist. I know that the "|" can be used in selectors like this: firstname=Mike|Steve What I'd like to do, however, is something like this: $recent_news_and_press = wire("pages")->find("press_exhibition=$exhibition_id | news_exhibition=$exhibition_id | press_artist=$exhibition_artist | news_artist=$exhibition_artist"); I know this is the wrong syntax, as it doesn't work. Is there a way to do this in one find query, or do I need to run all those queries separately, and then combine them into an array? Also, is there a risk of duplicate results when doing this sort of query, and if so does anybody have any advice on that? Thanks so much!