Jump to content

joer80

Members
  • Posts

    364
  • Joined

  • Last visited

Everything posted by joer80

  1. We really need an api way to pull a distinct list of pages, or one that is similar to mysql group by. The way processwire joins every column makes it a bit hairy to do this manually when you step outside the api. ie. Say you need to get pages using template model returning only unique model names and titles. Right now you would loop through every page adding them to a unique list array. When you get up to a certain size of database, it doesn't make sense to loop through every product page to make your list of unique models for say a select box when databases can just return a unique list. Needing to step outside the api at times is a big turn off I think.
  2. Ha! Found it. It appears if you login with www.suburl.com/admin/ it works fine on suburl.com, but if you login to mainurl.com/admin it will not print if you are on suburl.com. I was logged into the main url and trying to edit the page on the sub url!
  3. Does page->editable() work when you are on a sub website url? My edit this page code isnt working. I wasnt sure if it was a bug in my setup or if the code does't allow this? I am using soma's version.
  4. What about adding an api role so its different from users not logged in?
  5. Ah.. My first instinct for an important field is to remove guest access. Should this api checkbox be enabled by default? Or is it common that you would want to block the api from reading roles manged fields by default?
  6. You the man! As soon as I checked "Make field value accessible from API even if not viewable (see below)*" it showed up! All I checked was manage access control. What role does the api run as?
  7. Case doesnt seem to matter. If I do this: echo "<pre>"; var_dump($page->basestyle); //(now all lowercase) echo "</pre>"; foreach($page as $field => $value) { echo "$field = $value <br />"; } It shows this: NULL id = 1016 Design_Settings = BaseStyle = MiddleStyle = Design_Settings_END = $page->basestyle->title is also empty.
  8. I am not sure if I am using the api wrong or if something is broken. Been stuck for a bit. The page I am on has a page field I am using for a select option. I am not able to read it with api. I need to print out its title but it is coming back as empty or null even though it is set. $page->BaseStyle->title; Take a look at the attached screenshot! Thanks in advance for any help you can give!
  9. I am having a problem getting this to work inside a repeater. Is that a known issue? It is just printing out the url.
  10. Oh goodness. It doesn't look like it installs anymore either. As soon as you hit install it says: Recoverable Fatal Error: Argument 1 passed to ProcessWire\PagesType::__construct() must be an instance of ProcessWire\ProcessWire, instance of ProcessWire\Template given, called in /home/goac/public_html/inv/site/modules/DynamicRoles/DynamicRoleSupport.module on line 64 and defined (line 77 of /home/goac/public_html/inv/wire/core/PagesType.php) This error message was shown because: you are logged in as a Superuser. Error has been logged.
  11. Adrian, thanks for the tip! If I do my own, that will get me half way there! Robin, Nice! Why is that not in the modules directory? I looked through all of the roles modules. I will give it a go and see if it will do the trick! Thanks for all the help! I will let you know what happens!
  12. Would I be better to just design the website around fake templates? ie. create a "Dallas Inventory" with no file, and an "Austin Inventory" template with no file. Then make their settings load Inventory.php so they can share code if I want, and tie the users role to the fake template? I just would not be able to pull all the inventory at once by the template. I could pull it by other fields or their parent though? But then if I wanted to add a field to Inventory.php, and had 20 fake templates that implement it, I would need to add it to all 20 fake templates. :\
  13. So far it looks like most default roles situations revolve around the template level. I think I need to do something that can not be handled that way. I have pages that share the same template, but depending on the value of one of the fields in the template, I need to let certain roles have edit permission the pages. Example situation: Template is inventory and has a field that says City: "Austin" User is bob with the role "Austin Inventory manager". I need to let him edit inventory that has City = "Austin". I am thinking this is not built into stock processwire and I will add an auto load module and hook something that lets me allow or block the page edit permission for the user depending on the users role compared to this one field. I am just not sure where to hook. Any advice?
  14. Is there any way to make the tab look active/open in the header when you are on the dashboard?
  15. Ah. I tried that, but I had to hit Modules -> refresh to get it to pick up the changes! Then I got a file compiled message and they showed up as a site module. I was not required to select what version to make it load, it just started using the site version as soon as I hit refresh!
  16. Ok, I took the files in /wire/modules/AdminThemeDefault and uploaded them to /site/modules/AdminThemeDefault. It appears it is still loading the wire version though. Is there something I need to do to tell it to use the site one?
  17. I uploaded the /templates-admin/ folder to my /sites/ folder and the admin section is still loading the theme from the wire folder. Is there anything I need to do to tell it to load the sites version? ProcessWire 3.0.7 devns
  18. I have a RetailPrice field, a SalePrice field, and an AmountDiscounted field. I want to lock the AmountDiscounted field, and anytime the RetailPrice or Sale Price is updated, it calculates the differernce and sets the AmountDiscounted field. What is the best way to do that?
  19. Got it installed manually! Thanks! You guys should add it. I think it is a good way to access variables without touching the database and unnecessary creating tables.
  20. I tried to use this in a new project and ProcessWireConfig is no longer there. It says: Error reported by web service: Unable to find that module Is this still a good way to do things?
  21. For now this will correctly ignore subdomains but you must know the name of the sub domain. There is probably a way to make it work without typing it in: RewriteCond %{HTTP_HOST} !^(www|subdomainhere)\. [NC] RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  22. I think I might have found a bug in thedefault processwire .htaccess file. # ----------------------------------------------------------------------------------------------- # OPTIONAL: Redirect users to the 'www.' version of the site (uncomment to enable). # For example: http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301] It is common to need to preform a redirect like this to send non www users to a www address, so we include this code snippet in the default file that just needs to be enabled. It works great for domainname.com -> www.domainname.com, but the issue is it does not work for subdomains. We need to add code that does not forward a subdomain like test.domain.com to www.test.domain.com. Let me know if this is an easy fix! I could use it for the multi website project I am working on since the module only works on the www version. Thanks!
  23. Yeah, I think I did option #2 last time using that addon. I can do it that way again but wanted to make sure with 3.0 bringing name spaces in, there was not a core way to do #2 before I went this way.
  24. I am doing a new multisite install this week. I remember this being added to core, should I start there? Or should I go with the add on still? Is the core method in the beta 2 or 3 branch or in stable? I am wanting to do the one where a list of urls all load the same template files and share the same database. (Just load different tree branches) Thanks!
  25. I have been pushing it on quora and there are usually a few others that will as well. Thats a great place. ie. https://www.quora.com/We-need-a-CMS-that-manages-images-and-themes-but-does-not-enforce-some-framework-Any-suggestions or https://www.quora.com/I-need-a-website-Should-I-use-WordPress-or-HTML-CSS-more-info-in-description or https://www.quora.com/How-do-I-make-content-editing-easy-for-my-web-design-clients/answer/Joe-Regan
×
×
  • Create New...