Jump to content


ClintonSkakun

Member Since 23 Jan 2012
Offline Last Active May 10 2013 04:41 PM
-----

Topics I've Started

find pages with upper level parents that have x field value

13 April 2013 - 06:48 PM

I have a page architecture like this:

 

account-data

 - 1010 (account, owner=clinton, assigned_users=brian)

   - Some update

   - Some project

      - Some task

 - 1020 (account, owner=jack, assigned_users=brian,clinton)

 - 1030 (account, owner=tom, assigned_users=clinton)

 - 1040 (account, owner=jordan, assigned_users=brian)

 

What I want to do is give viewing permissions (for updates, projects and tasks) to users only if they are either assigned or own the parent account.

 

I need to find out a clean way of doing this. For example, I could do:

 

foreach($pages->find("template=task") as $item) { if($item->parents()->find("template=account,user|assigned_user={$user}")) ...

 

But looping through all of the items is a pretty heavy task.

 

Sometimes it has to go a few levels before finding the parent with the user info.

 

Is there a better way of doing this?


How do I get the ->next field in a repeater?

12 March 2013 - 07:49 PM

This is driving me crazy. I have a variable $course_page which is a repeater. I'm trying to get the next entry in the repeater. How?

 

I've tried getNext(), next() and next.


Possible to CSV Import into RepeaterFields

19 February 2013 - 11:45 AM

One of my clients may need to have the ability to import a csv of exam answers into PW.

 

The exam template uses repeater fields for the questions. Is this possible?


Suggestion for PW theme or future development

31 January 2013 - 11:17 PM

So this month marks an entire year since someone opened me to the world of Processwire. Can't believe it's been that long. I have to say that without PW I would have lost many hours of coding and recoding classes, setting up basic websites and database tables. Aside from that, the API is something I would have killed for 5 years ago. PW has already given me a load of leverage of building projects fast and making way more money in less time.

 

That said, after doing around 20+ installs since starting to use PW, I've noticed a few things about my work flow that I think could be improved. These improvements could spike productivity through the roof and save me even more hours and make me more dollars than before.

 

There's a LOT of back and forth when setting up a website in PW. What we need is a way to reduce the amount of time creating new templates, fields and pages, as well as editing all of this stuff. Today I was thinking, wouldn't it be great if there was a way to just add a new page by typing it in a new slot below the other pages, selecting a template and clicking save. By default a template could be selected, for example the allowed child templates or the default-page template. Also, it would be cool to add and edit templates on the fly as well. Let's say we create a new page, click add new template (JQuery window pops up) and we can either add or edit the template right there as we're creating a new page. Also we could create new fields while editing the template. That way we could create a page on the fly with minimal settings, set up the template, add any additional fields we need and save it and publish it all in the same area.

 

Now, this would not be easy to code by a long shot. Would take a lot of ajax calls and JQuery to get it to work. But having something like that would be wicked. With this, we could basically set up a page tree in 10 minutes or less.

 

I know the obvious answer is, "well, go and code it," I seriously don't have the time for this right now. ProcessWireSexy was my planned theme but I'm still trying to find time to even start on it.

 

Is there a theme out there like this that someone has already made? Someone has to have already thought of this.


Use both local and external templates

19 December 2012 - 02:15 AM

Ok, this might be a little unique, not sure.

Basically, I have already accomplished getting PW to use an external path to another domain to grab a directory of global templates I need for this app I'm creating.

But now, I also want to allow clients to have local templates. So what I want to do is allow Processwire to search both the local templates dir and the global one on the other domain.

Is there a way to do this? There's only one path, but is it possible to include from two paths without re-coding a bunch?