-
Posts
4,632 -
Joined
-
Last visited
-
Days Won
55
Everything posted by apeisa
-
Got one little problem: it seems that my subUrl method is not available through page field it is working. This is still valid question though: Is there easy way to manipulate value that all url methods return? Using subUrl is fine, but I cannot use my old snippets and functions...
-
Stephen: check_access=1 is default, so you don't have to include that. If you don't want to check access, then you need to use check_access=0.
-
Haven't tried repeaters yet. What you mean by the page that doesn't resolve? My guess is that it has something to do with page-edit permission. Maybe editor doesn't have real edit access to repeatable pages?
-
Yes, even this will be very handy in many occasions. Tags, categories, select values.. even more complicated stuff, where you are ok with just title added are fine.
-
Repository of php Scripts for Templates
apeisa replied to thetuningspoon's topic in Wishlist & Roadmap
Good idea. One way to go would be to post those code snippets to Gist (https://gist.github.com/) and build the snippet repo on top of that. They would be tied to github account, so it would nicely show all the modules and snippets build be same author. -
I have seen that sometime ago, but didn't find good reasons enough to test it. Little ot, but how about New Relic, anyone have any experience? http://newrelic.com/
-
I have used HTML Kickstart for one quick prototyping session, never had used it before and it worked flawlessly. I will probably use it in real projects later on. For some reason I have never felt home with Twitter Bootstrap - don't know why.
-
I changed that cropping requires only page-edit permission. So if you update and have used this before, you can remove that image-crop permission.
-
Since both are "custom field" cms, basic import should be simple. Of course if you have little bit more complicated site you do have much more to think about (stuff like drupal taxonomy => page relations, other relations, user import, drupal navigations => pw page tree, custom modules etc).
-
Include & Bootstrap is when you have whole PW included or you run it from shell script or something like that. wire('pages')->get('/')->id should work everywhere and return 1.
-
Add new parent page? I guess you mean more like a sibling page
-
wire('pages')->get("/")->id
-
You have two options inside function: wire('pages'); wire('config'); wire('page'); or then passing needed variables as function params: renderSubmenu($page); function renderSubmenu($page) { ... }
-
Great news, very nice work for first site.
-
Nice work! Clean design and scales very nicely. Was this your first PW-site?
-
I created simple module to add these subsites. You need to use $page->subUrl or $page->subPath if you want working urls/paths. Not sure if it would be better to use $page->url and $page->path... and how that could be achieved? Anyways, I have this version up and running nicely: <?php class Multisite extends WireData implements Module, ConfigurableModule { public static function getModuleInfo() { return array( 'title' => 'Multisite', 'version' => 001, 'summary' => 'Allows multiple sites with different domains run from single PW-site and database.', 'singular' => true, 'autoload' => true, ); } public function init() { $subdomains = explode("\n", strtolower($this->subdomains)); foreach($subdomains as $subdomain) { $httpHost = strtolower(wire('config')->httpHost); if(strpos($httpHost, $subdomain) !== false) { $this->subdomain = $subdomain; // change path like /about/contact/ to /campaign.com/about/contact/ $_GET['it'] = "/{$subdomain}/" . ltrim($_GET['it'], '/'); // hook for path method to make path() and url() methods context aware $this->addHookAfter('Page::path', $this, 'modifyPath'); } } } public function modifyPath($event) { $event->return = str_replace("{$this->subdomain}/", '', $event->return);; } static public function getModuleConfigInputfields(array $data) { $fields = new InputfieldWrapper(); $modules = wire('modules'); $field = $modules->get("InputfieldTextarea"); $field->name = "subdomains"; $field->label = "Other sites running from same install"; $field->description = "Add each domain for their own line. Don't add http or https, just simple domain like: www.example.com tai campaign.example.com"; $field->notes = "IMPORTANT: create homepage for each of these domains right on the root. Name should be exactly same as the domain you use here."; $field->attr('value', $data['subdomains']); $fields->add($field); return $fields; } }
-
I was able to add new method, like url2. Not sure which one would be better solution?
-
Hmm, tested this now. As Ryan assumed, the www.campaigndomain.com serving files from www.site.com/campaigndomain.com was a breeze. But manipulating urls on the fly isn't so easy. I tried to hook before page render and manipulate url and path, but wasn't yet successful in that.
-
This might get little bit more complicated, than manipulating only $_GET['it']. Mainly because of urls: $page->url should return /page-name/ instead of /campaign.com/page-name/ (if I am under "subsite"). Otherwise I would end up links like www.campaign.com/campaign.com/page-name/ and it would actually try to load page campaign.com/campaign.com/page-name Oliver: not sure I understand that context thing well enough to say if it could work here. It sounds like it could
-
Just realized that this module handles only view access. Looking at the code it seems like it could be relatively easy to extend for edit also, but how about other aspects (like creating new pages etc)?
-
Ryan, what you think about current status of this module? Do you think it will be core module at some point (disabled by default of course)? I have site where is 5 main sections. All those 5 section have same template called "section". I use that information in many places of my code. Now client needs to have roles which can only edit pages in certain sections. If I would have known that before, I would probably added own template for each of those 5 main sections. But afterwards this is much more work, since I rely on that "section" template on many of my selectors etc... So I think that page-based access management might be best way to go here. All pages are public, this is only about editing access.
-
Alex: edit the home-template, access tab and see that you have allowed creating pages and add children for your custom role.
-
Yep, that would be good solution. Other thing that people do is to have more deeper structure: /1/1001/image.jpg /1/1002/another_image.jpg ... /2/2001/filedump.zip /2/2002/image.gif ... /10/10201/file2.jpg /11/11390/fileX.zip ... /23/231021/file3.jpg ... /191/1912621/scalesforovermillionpages.jpg ... etc Changing file structure might be hard thing to do, but it would prevent scaling issues with pages where you host large amount of files and use pages as containers for them. Deeper folder structure combined with "folders created when first file uploaded" would be best solution, I think.
-
Probably best way to use some custom tag like #PAGEBREAK# and then use some logic and urlSegments to split those into different pages. But usually I would try to avoid multipage articles. Only reason those exists are that sites running ads want to maximize their page views.
-
ReCaptcha is pretty damn hard to get right for a half human like me