Jump to content

Front end editing for a page field


Hantsweb
 Share

Recommended Posts

I'm developing a test site using the latest version of Processwire and making use of the front end editing which works superbly, however, I've hit a problem with selecting via a dropdown

Here's the scenario - my supplier page has a country field --- this actually displays the title field for my country template.
This all works fine - I have the field enclosed within edit tags as per below

 

<edit field="country">
<?php echo $supplier->country->title; ?>
</edit>

This  displays the current country name for the supplier. When I double click on the country name displayed, it opens a dialog and lets me choose the required country from the drop down list within the dialog - this all works fine.

However when I click the Save button on the dialog, the dialog closes and I am returned to the supplier update page, all fine, but the supplier country is now still showing the original value and not the new value I chose in the dialog.

I'm sure all it needs is a small bit of ajax but I've been playing with this for several hours now so I thought I would ask on here to see if someone could provide an answer for me.

Many thanks

ps: I'm sure it's probably just me missing something...

Link to comment
Share on other sites

Hello Hantsweb,

on a project I am currently working on, I enabled the front end editing option for a page field using Option D. So in your case it would something look like this:

<div edit="country">
<?php echo $supplier->country->title; ?>
</div>

Of course, if country is the name of your page field.

I haven't fully tested out the front end editing options yet, but I noticed that with Option C, the </edit> tag doesn't get stripped out if you are not logged in. That bothered me, so I find Option D more useful.  ;)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...