Recently Browsing 0 members
No registered users viewing this page.
Hello fellow Process wire Developers!
Today i have encountered an issue using the repeater where I can't find out how to solve it therefore i am asking for help.
To be specific, I am trying to get the "file" field working properly in the repeater but i couldn't find a way on how to assign a property of a field that is being used by the repeater.
download_pdf is the name of the field that i want to access properties from.
What i wished i could do was something like $download->download_pdf.size or $download->download_pdf->name, something like that but obviously these didn't work
Hope there is a solution and thanks in advance!
Another dumb question:
Is there a field type for a text-based array?
In my case I need to store an array of RSS feeds for SimplePie. Storing that list of links in a textarea - text formatted to look like an array - doesn't work with the script. It works with one link.
The images field is an array. I assumed there would be an equivalent for URLs or text in general.
Or is there another approach for these cases?
I guess using the optional (module) Repeater field type is the best solution in this case? I have now a working solution based on that. Still curious about other ideas.
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?