Recently Browsing 0 members
No registered users viewing this page.
By Sonia Margollé
I have a problem and I don't understand. I have a profield table with different fields and a select field.
I did like it's instructed and put "value=label".
But when I'm trying to output the select field with var_dump (to debug), it's indicated that the field is a string that contains the value.
Why is it a string ? when I try myselectfield->value or label or title I have an error saying I'm trying to get a property on a non-object ...
This is a pretty typical thing. Open a page, it does a $pages query, finds 112 things and I list them on the page. There is pagination too, 20 per page.
I want a sort dropdown box so the visitor can change alpha sort or whatever other sorts and filters I eventually use.
My first thought is to just refresh the page with a url query like "page/?sort=az" and then adjust the query in the template code. But to do this, it will require a page refresh, which means the sort box goes back to its default, and not sure how it effects pagination.
If I do a page refresh, I'll have to keep the sort settings in the session or something, to make sure I always apply correct sort on page load.
But at the same time, I've already got the $pages array, it would be much nicer to shuffle it and update the page without a page refresh, rather than run the query over and over again.
But then again, the pagination buttons already cause page refreshes, so that is already happening anyway, unless I convert the pagination buttons to also be no-refresh somehow.
I figure this is a very common problem, to paginate results and give users a sorting/filtering option. What is the common methods for handling it? Session, url query, ajax? If I just add the sort to the url query, how do I make that work in the pagination links?
I'm trying to echo a field from another page, in my footer. I have a Website Settings page (id 1006) with several fields for general site settings, like store hours (field is named store_hours). In the footer, I have this:
<?php $settingsPage = $pages->get(1006); echo $settingsPage->store_hours; ?> Shouldn't that output the contents of that field? Right now it's printing a "0" (zero) on the page.
Elsewhere in the same footer template file, I have this code and it works fine:
<?php $homepage = $pages->get(1); echo $homepage->body; ?> Does it have anything to do with the fact that the field is organized into one of these tabs, at the top of the page editor?
(disclaimer: I'm new to PW, and have inherited this site from another developer; that's why I don't know how or why some of this stuff is set up the way it is).
I'm creating a multilingual blog for a client. I'm using Multi-language fields, and it's working great. Essentially, there are two versions of each article: one in English and one in Spanish.
Now, I've created a Datetime field with a "Date/time picker" so that they can add a publication date (no time) to their blog entries. I want the month part of the date to be displayed in whatever language the article is being displayed in. Let's take the following example:
1) "Un artículo de ejemplo", accessible via example.com/un-articulo-de-ejemplo/
2) "A sample article", accessible via example.com/en/a-sample-article/
In this example, for article number 1 I want the date to be "12 ene 2017", and for article number 2 I want it to be "12 jan 2017". In other words, the same format for both languages, but localised. And for some reason, I seem unable to do so and dates are always displayed in English.
Here's the code I'm using to display the date field:
<?= $post->publication_date; ?> How can I get this to work? Thanks.
By Robin S
In response to a wishlist request...
Field Save + Add New
Adds a "Save + Add New" button when editing a field.
Install the Field Save + Add New module.
When editing a field, click "Save + Add New" if you want to save the current field and start the process of adding a new field.
Note: The button will not redirect you to "Add New" if you are performing some special action such as duplicating a field or adding a field to a template.