patzer
Members-
Posts
17 -
Joined
-
Last visited
Everything posted by patzer
-
Ahhhh! This is my confusion. Looks like I may not need a repeater field at all, as the image field is an array by default. (May keep it so I can add accompanying text, though. This is for a carousel.) Let me go experiment with the understanding that the image field is an array. Edit: And, it worked! Man I was tearing my hair out about this.
-
Sorry, I should have specified that $header_imgs is a repeater. It has only one field at the moment, which is $header_img, an image type. I'm still unclear as to why I get the base path of the image rather than the full image URL. From your example above, is <?php // get image $img = $pages->get(1)->header_img; // output image url echo $img->url; different from echo $pages->get(1)->header_img->url; ? I've gotten around this before by appending $file->name; but this shouldn't be necessary? Thanks!
-
Hi. I've tried this a couple of different ways, but whenever I call $img->url like so: <?php $img = $pages->get(1)->header_imgs->pop()->header_img ?> <img src="<?= $img->url ?>" alt="<?= $img->description ?>"> I get output like this: <img src="/site/assets/files/1035/" alt=""> No file name. Any tips??
-
Great! Works perfectly. How can I easily find the page_ID of any page? (1 is obvious, but maybe not the others?)
-
Can I pull data from a field on a different page? If so, how? Thanks!
-
Homebrew is just so much better than MacPorts or any of the other prior attempts at package management. It works really well. Fast, light, no sudo privileges needed. I use it with the Apple command line compiler, so no need for Xcode on my SSD. http://mxcl.github.io/homebrew/
-
A big +1 for using meaningful tags. I'm importing ProcessWire into a project as a git submodule, and those work by referencing a specific commit (or, better yet, tagged commit). Thanks!
-
Git gurus - pull from core, push to private repo?
patzer replied to patzer's topic in Getting Started
I've been using the submodule method all day and it seems to work well. I made a soft symlink from /wire to /ProcessWire/wire. I did have to add an .htaccess file into the /ProcessWire directory like so: Order deny,allow Deny from all Otherwise you could browse to the ProcessWire directory and start the install process in the sub-directory. -
Hi all, I'm tickled with my new local dev setup, and I thought I'd share in case anyone else wants to try it out or offer suggestions for improvements. Prerequisites: I'm using a Mac running OS X Mountain Lion. 1. Install Homebrew 2. MAMP + dnsmasq (http://eddmann.com/posts/the-ultimate-mamp-setup-hands-down/ and http://www.echoditto.com/blog/never-touch-your-local-etchosts-file-os-x-again)* * There is currently a typo in the first link's instructions. You need to use address=/.dev/127.0.0.1 in /usr/local/etc/dnsmasq.conf (note the dot in .dev for TLD). I add Homebrew's PHP to /etc/apache2/httpd.conf like so: LoadModule php5_module /usr/local/opt/php54/libexec/apache2/libphp5.so Then issue a sudo apachectl restart. The first time I hit a new site locally, I need to type the full http://mysite.dev to stop Safari, e.g., from searching Google rather than navigating to the URL. After that it remembers and all is well. 3. Install git vie homebrew and configure; create repos on BitBucket for remote storage. Use git submodules (planned) for ProcessWire and other components, like Bootstrap. I make a "live" branch that I can pull to the server when I'm ready, and other branches as needed. I'm shuffling local tools at the moment, but using TextMate 2 as a primary editor and thinking of CodeKit for browser refresh and LESS/Sass compilation. Wish CSSEdit hadn't been killed as a stand alone product instead of being wrapped into Espresso. On the browsers I'm using a mix of FireFox with Firebug and FireSass, Google Chrome with dev tools, and Safari. I think that's it, so far! EDIT: I did need to uncomment the RewriteBase / option in .htaccess
-
Git gurus - pull from core, push to private repo?
patzer replied to patzer's topic in Getting Started
On further investigation, I think git submodules is the right way to go. http://git-scm.com/book/en/Git-Tools-Submodules I've not tried this yet, but am going to for my next project. -
(I should add that I'm using the dev branch of ProcessWire from GitHub.)
-
Looks like lots of interesting improvements to internationalization in the works. I'm currently building a site in English and Spanish. Each page is in both languages. What's the current recommended approach to tackle this?
-
Git gurus - pull from core, push to private repo?
patzer replied to patzer's topic in Getting Started
I'm going to try using a new branch. Here's the discussion on StackOverflow: http://stackoverflow.com/questions/15500144/use-gitignore-on-a-per-remote-basis -
Hi folks, I downloaded PW from its git repo on GitHub. I set up a private repo at Bitbucket to check in and store my local changes. Problem is, .gitignore (from PW's master repo) tells git to ignore site/ (which makes sense for the core application), but that's what I want to track and push to my private repo. I'd like to keep the PW core in git so I can pull updates from GitHub. Anyone have a solution to this? Thanks!
-
Awesome. I was wondering about that!
-
Thanks! Here's what I came up with while waiting. Not as succinct, but seems to work. <h4><?=$page->parent->title?> Navigation</h4> <ul class="nav nav-pills nav-stacked"> <?php foreach($page->siblings() as $sibling) { if($sibling === wire("page")){ $class = 'active'; } else { $class = ''; } echo "<li class='{$class}'><a href='{$sibling->url}'>{$sibling->title}</a></li>"; } ?> </ul> I like the way you used the ternary operator. I'm going to steal that and trim down my code. Thanks!
-
Hi folks! PW newb here. I'm trying to make a sidebar menu of sibling pages when I'm in a subsection. So, HTML like: <ul class="nav nav-pills nav-stacked"> <li class="active"><a href='/page1'>This page title</a></li> <li><a href='#'>/page2</a>Page 2 title</li> <li><a href='#'>/page3</a>Page 3 title</li> </ul> I gather I can grab a $page->siblings object and iterate through? Can someone give me an example? Also, how best to test for the current page to make it active? Thank you!