Jump to content


neildaemond

Member Since 21 Oct 2011
Offline Last Active Today, 10:00 AM
-----

Topics I've Started

"URL /subdir/processwire/page/edit/saveTemplate was not found" when trying to c...

12 May 2013 - 05:18 AM

Hi,

 

Sometimes when I try to change a page's template, I get this error thrown up by apache upon clicking 'save' :

Not Found

 

The requested URL /subdir_my_project_is_in/pw_admin/page/edit/saveTemplate was not found on this server.

 

Additionally, a 401 Authorization Required
error was encountered while trying to use an ErrorDocument to handle the request.

 

Usually I just delete the page and add a new one with the same name, but this time I'm trying to change the '404 Page Not Found' page's template and am hesitant bc I'm not 100% sure how it's being reffered to.

 

Could this be a problem with how my PHP is configured? or related to the fact that my website is at subdirectory (/var/www/project/) instead of the web root (/var/www/)?

 

Thanks


create pagearray field with api? (multipage select field?)

21 February 2013 - 10:54 PM

Quick question for anyone who is familiar with it..

If creating a new text field with the api looks something like this:

$nf = new Field();   
$nf->type = $this->modules->get(FieldTypeText);
$nf->save();

Then how would I create that field which allows me to select multiple pages (which module do I get and set type as)

I usually just choose from modules under wire/modules/Fieldtype. But, in this case I'm not sure which one it is.

I know I could dereference any pagearray as a string and save the pipe delemited string to the text field, but I'd liek to have the pageselect functionality in the admin.

Thanks In Advance

google analytics showing pages that look like /page/subpage/www.domain.com

25 January 2013 - 03:54 AM

Hi guys,

 

for some strange reason,  under the google analytics, I'm seeing pages like:

 

/address/of/page/www.domain.com

/address/of/other/page/www.domain.com

 

and they seem to be getting hits.

 

I've recently added page link abstractor to the 'body' textarea field, and I know it only works for text after it is saved (therefore, shouldn't affect original fields).

 

anyone ever seen bahavior like this?

 

weirdGApages.png


get and post variables are not being passed to page

19 December 2012 - 07:52 AM

I'm trying to get Paypal express checkout working... After going through the process, paypal redirects me back to my site where I'm supposed to grab the get variable 'token'

anyways, I could never see it, and finally tried getting paypal to redirect to a page outside the PW site with the same code. The variables were now there.

Come to think of it, I haven't been able to post forms to other pages either. The forms work when they post to themselves, but not when they post to other pages.

Is this a security measure so that people cannot post false values to the page?

Perhaps there's a setting somewhere I can change?

EDIT (Solved):

I went to

setup => templates => template name => urls

and I set "should page urls end with a slash?" to NO.

EDIT (Even Better Solution):

Make sure my return urls have slashes on them, also my urls in forms. Thanks Soma!

Create and Access child pages for $user

17 December 2012 - 10:30 AM

I'm creating a service which sells something like a subscription to a product.

First, someone inputs their preferences, then if they are not logged in the preferences are saved to session variables while the user is prompted to sign up or login. Upon sign up, the session preferences will be used to create an order for the subscription.

This order is actually just a page created as a child of the user, using the 'order' template.

I've managed to create the child page of the user by making its parent equal to $user. However, I want to list out all the user's orders but I don't think I'm doing it properly.

making the 'order':

	    $b = new Page();
	    $b->template = 'order';
	    $b->parent = $user;
	    $b->name = 'order' . $b->created ;
	    $b->title = 'Order For '.$session->order_name ;
	    $session->order_name = '';

	    $b->save();

trying (but failing) to list out the orders:

foreach($user->children() as $order){
	    echo $order->name;
}

How can I make it so a user can view their child pages? or is it just a bad idea to make these orders as children of the $user? Should I instead just create orders under a page(directory) named /orders/ ? how would I protect those?

the $user is not a superuser, nor does it have any associated roles yet. perhaps I need to give them a role and allow that role access the page? however, that may give all users with that role access to pages which aren't theirs. Maybe i need to use that module which allow user access to one page(i havn't tried yet). I will try these guesses first...

Thanks in advance for any advice,