adamspruijt
Members-
Posts
156 -
Joined
-
Last visited
-
Days Won
5
Everything posted by adamspruijt
-
I'm actually using the dev branch as I notices some language related changes... still not working. So I think it has to do with my poorly written language selector, I have a simple select field in the top right of the site, I need this to be able to switch me to different subdomains based on the found langues... if that makes sense? I'll attach the code. <select name="lang" id="lang_select"> <?php foreach ($languages as $lang): ?> <?php if($config->httpHost == "$lang->name.$domain") { $user->language = $languages->get($lang->name); }else{ $user->language = $languages->get('default'); } ?> <?php $selected = ($lang->name == $user->language->name ? 'selected="selected"' : '') ?> <?php if ($lang->name == 'default'): ?> <option <?php echo $selected ?> value="http://<?php echo $domain.$page->url ?>">English</option> <?php else: ?> <option <?php echo $selected ?> value="http://<?php echo $lang->name.'.'.$domain.$page->url ?>"><?php echo $lang->title ?></option> <?php endif ?> <?php endforeach ?> </select> note** $domain is a predefined static variable... because I was being lazy and didn't want to grab the base domain with php.
-
I believe render is meant to be used on an array: $footers = $pages->get("/home/blocks/footer-blocks/")->children("limit=3"); $footers->render(); I'm not certain though, never really used it.
-
Hi all, hopefully this is an easy fix. It seems the default behaviour for PW is to cache only the first language of a page as it is accessed. So you get a file like 1234.cache. I tried search around the forums here and found some mention of "secondaryID" and that it could be used to allow alternates of cached pages? (correct me if that wrong). Either way I was hoping to alter the cache file naming so that I could end up with something like this (or similar) 1234.default.cache 1234.fr.cache 1234.cn.cache Thanks!
-
Trouble with install (Rackspace Cloudsites)
adamspruijt replied to adamspruijt's topic in General Support
The Rackspace backend just says 5.3, no more details, I can get more from phpinfo if you want. The thing about this is that I tried it local, on two different VPS systems and a shared hosting plan we have, and they ALL worked. It's for the best RackSpace is slow for the price, there focus seems squarely on ease of use, which is a big plus for some, but usually just drives me nuts. -
$footers = $pages->get("/home/blocks/footer-blocks")->children('limit=3'); I know right, too easy. That all you need for the limit at least. Generally the rest sounds doable, ProcessWire won't dictate the method so it's up to you really.
-
Trouble with install (Rackspace Cloudsites)
adamspruijt replied to adamspruijt's topic in General Support
No worries for now on this guys I think I'm going to switch hosts. Although this may be good to keep in mind if anyone understand what's causing this limitation. -
Hey all, hopefully this is an issue that someone here has some experience with. I'm doing a typical ProcessWire install with the latest master from Github. The install goes smoothly it seems but once I'm finished and I try to access either the front end or admin I get: Error Call to a member function getLoadQueryAutojoin() on a non-object (line 309 of /web/content/wire/core/Pages.php) I've never really had issues installing ProcessWire before, its about as typical as CMS installs get. I tried doing a dump of my database (assuming that this error seems to be telling me data is missing?) but when I tried to import the sql file it wouldn't complete succesfully (sorry I don't remember the error I got for this). Any help is appreciated, even if it means I have to my work away from Rackspace.
-
Permissions Roles Templates - How to set view only
adamspruijt replied to NooseLadder's topic in Getting Started
Check the access setting on the Home template, the default behaviour dictates that children inherit these settings. Basically your user isn't allowed to view the Home template and as a result, everything below it, This applies to editing, I didn't read closely enough, apeisa's answer sounds correct. -
Using pagination with Twitter Bootstrap framework
adamspruijt replied to ljones's topic in General Support
Two quick things really. 1) Make sure your pagination output is wrapped in a div with the class "pagination" (this will get you about 90% of the way) like this <div class="pagination"> <?php echo $yourPageArray->renderPager() ?> </div> 2) Find the pagination css in bootstrap that contains the "active" state looks like this .pagination ul > li > a:hover, .pagination ul > .active > a, .pagination ul > .active > span{ background-color: #f5f5f5; } and change it to include the Processwire "MarkupPagerNavOn" class like this .pagination ul > li > a:hover, .pagination ul > .active > a, .pagination ul > .active > span, .pagination ul > .MarkupPagerNavOn > a, .pagination ul > .MarkupPagerNavOn > span { background-color: #f5f5f5; } and that should do it. Hope this helps! -
Programmed page creation: import image from URL
adamspruijt replied to Adam Kiss's topic in API & Templates
Great, thanks Ryan, that looks like basically how I had it, having you confirm that really helps my understanding! I've tweaked my import so that it only grabs images for newly created pages and that really speeds thing up for obvious reasons. -
Totally agree alanfluff, I was thinking the same thing, I know some people don't really dig deep in to licences when building these types of projects. I respect Ryan's commitment to doing this properly. If the Redactor module needs to be distributed separate I see no problem with that, but it would be lovely to have it be the default.
-
Candy CMS is using and distributed with Redactor, they use a GPLv2 licence (not that I understand that stuff very well).
-
I'm confused as to why the module would have to be commercial? The OEM version of the licence doesn't seem to require this. Maybe I'm wrong. Keep us posted Ryan
-
Programmed page creation: import image from URL
adamspruijt replied to Adam Kiss's topic in API & Templates
Sorry Ryan, I wasn't very clear, the $entry->images->profile part is from the xml object that I am referencing, this is for an import from a live wordpress site, but I am using a custom export XML structure because of limitation in the default wordpress export xml. xml example <entry> <images> <profile>http://www.site.com/image.jpg</profile> <banner>http://www.site.com/otherimage.jpg</banner> </images> </entry> Basically a "listing" has various images (profile, banner, etc). So basically I'm just sending a image URL through to the import script (www.site.com/image.jpg) and on first run it fine, but on second run of the import script I have a second "profile" image. Instead of the image just being updated I get incremental additions (1_image.jpg, 2_image.jpg and so on). From my understanding of what you posted above I should get this if the imagefield is set to accept one file. What you just posted looks like conditional code to only output the image if it exists, I'm trying to save the image to the page or replace it if it already has one. Thanks for taking a look at this, I appreciate it. -
Programmed page creation: import image from URL
adamspruijt replied to Adam Kiss's topic in API & Templates
Sorry to resurrect this thread, I've done a fair bit of searching around the forums and this thread outline my situation almost perfectly. Up to a point. I have a single image field (set to accept only one image in the setting) and each time I run my import script a new duplicate image is added to this "thumbnail" field. I have followed Ryans post as it is above, using $page->thumbnail = $sanitizer->url($entry->images->profile); Is there something I'm missing, possibly something that has changed in the API since this post? I tried using: $page->thumbnail->set($sanitizer->url($entry->images->profile)); on a whim but that didn't work (couldn't hurt to try ) EDIT: if I use $page->thumbnail->deleteAll(); before adding the image I end up with just one image, but this seems kinda wrong... but I'm new, so maybe its fine and I'm just wrong -
As my first post here on the forums, I'd like to put my vote behind this editor. Redactor has been a favourite for a while and the devs really seem committed to making a sleek, fast and beautiful tool.