Jump to content

Search the Community

Showing results for 'runtime'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Product Groups

  • Form Builder
  • ProFields
  • ProCache
  • ProMailer
  • Login Register Pro
  • ProDrafts
  • ListerPro
  • ProDevTools
  • Likes
  • Custom Development

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 16 results

  1. This is a module that is similar in purpose to the Runtime Markup module. I made it primarily for my own use but am posting it here because I had a request to add it to the modules directory. Fieldtype Runtime Only Not a proper fieldtype because it doesn't save data to the database. The fieldtype only exists to provide a convenient way to add an inputfield to templates that will render some markup at runtime. For a field named "my_field"... Inputfield markup will be rendered from a file at /site/templates/RuntimeOnly/my_field.php. In addition to the standard ProcessWire variables this file receives: $page - the page being edited. $field - the Field object. $inputfield - the Inputfield object. JS file /site/templates/RuntimeOnly/my_field.js will be added to admin if that file exists. CSS file /site/templates/RuntimeOnly/my_field.css will be added to admin if that file exists. Tips Output formatting Output formatting for $page will be off in the context of Edit Page so if you want to use the formatted value of a field in your RuntimeOnly code you should use $page->getFormatted(). E.g. $value = $page->getFormatted('some_field_name'); Repeaters If the RuntimeOnly field is used inside a Repeater field then you can get the Repeater page it is on via $inputfield->hasPage. E.g. $repeater_page = $inputfield->hasPage; // Use $repeater_page as needed echo "The name of the repeater page is $repeater_page->name"; https://github.com/Toutouwai/FieldtypeRuntimeOnly https://modules.processwire.com/modules/inputfield-runtime-only/
  2. Hi, I'm trying to change a template file at runtime based on the logged in users name. in addition to the /site/templates/ folder I have a /site/templates-dev/ folder, and under that is a folder for each developer. so, if I'm logged in as `timmy` and a file exists at `/site/templates-dev/timmy/article.php` then that file should be used, otherwise use `/site/templates/article.php`. in /site/ready.php I have $fp = $config->path('site') . 'templates-dev/' . $user->name . '/' . $page->template . '.php'; if(file_exists($fp)) { //echo "found tpl!"; $page->template->filename($fp); } If I uncomment the `echo` statement then I can see that it's finding the alternate template but if I view the page it's just blank (status 200, 'this request has no response data available'). Is anyone able to point me in the right direction please? Thanks, Martin.
  3. Hello, I am using shared VPS and have access to htaccess. I increased filesize limit to php_value upload_max_filesize 100M php_value post_max_size 100M However, I bump into running out of memory error when uploading really large file. I am really not excited about increasing memory limit in the .htaccess settings, I'd rather make it conditional and increase it (or use -1) runtime, when admin uploads something. What would be the best way/place to do it?
  4. Context: I have a (html) table of financial data in a back-end dashboard. Each element of the table is the sum of values from certain pages (for which a selector has been constructed). What I want to do is add a link for each element to a lister page showing the pages that go to make up the element. i.e. a link to a lister page which uses the constructed selector. This sounds like it ought to be easy, but I've been chasing around for a while now and can't seem to crack it. What I've tried: supply a GET var with a csv of the required page ids - /?open=1,2,3 - this seems to have no effect; use ProcessPageLister::addSessionBookmark() - I can't find much documentation about this, particularly regarding the format of the $bookmark array to be supplied. I tried the array structure I inferred from the code, viz: ['id' => , 'title' => , 'desc' => , 'selector' => , 'columns' => , 'sort' => , 'share' => ] but the selector seems not to be recognised (all pages are selected); use a session var to communicate the selector to a hook before ProcessPageLister::renderResults - at least with this, the selector gets recognised, but it will be messy to operate because multiple selectors would be required to handle all the table elements (or some js would need to be added to see which one was clicked) I really feel it ought to be easier than this and that I'm missing something obvious. Can anyone shed some light please?
  5. During testing of the https://processwire.com/talk/topic/22847-processwire-dashboard/ module I've created this simple demo inputfield to show how Inputfields can be used as presentation blocks in ProcessModules. The result is this little inputfield that shows the getting started chart of chartjs: https://www.chartjs.org/docs/latest/ https://github.com/BernhardBaumrock/InputfieldChartDemo It comes with 2 ProcessModules 1) One single chart inputfield 2) Grid Demo Creating an Inputfield is really nothing more than creating a module file having 3 methods: <?php namespace ProcessWire; class InputfieldChartDemo extends InputfieldMarkup { public static function getModuleInfo() { ... } public function ___render() { ... } public function ___processInput($input) { return false; } } Place this in /site/modules/YourModuleName, name the class exactly the same as your folder and you get an installable Inputfield that you can use everywhere in your admin and share across projects! Creating a ProcessModule is also very simple (see this old post): You do even need only 2 methods in this module! <?php namespace ProcessWire; class ProcessInputfieldChartDemo extends Process { public static function getModuleInfo() { ... } public function execute() { ... } } Using these internal tools it is really easy to create totally tailored user experiences for your clients in the PW backend!
  6. Hi everyone! Does anyone know if I can tweak field access on runtime to hide fields in ProcessPageEdit depending on some other field conditions. Eg. I want users to be able to edit the data if they are asigned to said page, or they created it and if not, hide the fields. Right now I'm wiping the fields with a hook on ProcessPageEdit::buildFormContent, but for example, I'd like to leave the title field intact and some other "common" fields amongst the users.
  7. How to enable urlSegments runtime instead of persistent in template settings? And where to be loaded before the current page returns a 404 error? https://processwire.com/docs/front-end/how-to-use-url-segments/#how-do-you-enable-url-segments
  8. Hi all, I'm trying to unpublish a page at runtime, depending on the value of a page field. I tried to do it like this in the file ready.php: if ($this->page->hasField("showPageIn") && $this->page->showPageIn->has("title=Dev")) { $this->page->addStatus(Page::statusUnpublished); } However, it doesn't quite have the intended effect. When I render the page in the frontend, I get an error: Exception: Page '[my url]' is not currently viewable. (in /home/me/public_html/wire/modules/PageRender.module line 388)" I'd like the page to behave like a page whose "published" flag in the settings is unchecked. Any help/solution is highly appreciated. Thanks!
  9. I'm rendering some markup in page edit UI with help of hook ProcessPageEdit::buildFormContent (example here: https://processwire.com/talk/topic/10539-how-to-render-runtime-markup-custom-php-snippet-in-page-edit-interface/) It works OK until you decide to use ajax-driven Fieldsets. Q1: how to render runtime markup in page edit interface if markup is inside of ajax-driven Fieldset? Q2: how to "ajax"-inize custom Inputfields/Fieldtypes?
  10. I'd like to create field that renders runtime markup (=custom PHP snippet) in page edit interface. E.g. smth like combination of FieldtypeConcat (for runtime calc) with Inputfield (that holds PHP snippet). My own attempts to do this failed so far.) Being new in module development I can't figure out how&where to save PHP snippet and how to load it... w/o damaging smth...) E.g. should I create table? or dbScheme? where field settings are saved? please help. Thanks! Pleae have a look at what I've coded so far: https://github.com/valieand/FieldtypeRuntimeMarkup
  11. I need several fields that will be calculated at runtime like Concat but (a) based on PHP code (b) it should be visible & locked in admin UI. I'd also use this filed in custom Listers. Example - "total price" which is calculated based on some logic and fields inside "order" page as well as fields outside of the page. Should I develop new Fieldtype? Or there is something ready to use in PW 2.5?
  12. Q: see topic title As far as I understand there should be at least two ways: - kind of locked Textarea/CKEdit field that is filled with markup being generated from PHP snippet when page is opened in edit mode - some kind of hook that injects markup into the edited page in right place I've checked available modules but haven't found the answer. If this kind of Q has been addressed somewhere before, I would be glad to hear about it!
  13. Anyone else having trouble logging into #xero today? @Xero Getting a Runtime Error - Server Error in ‘/‘ Application

  14. Hi all, I am listing a gallery of products and each product, there is the possibility of seeing a rapid or enter the product and see it in detail view. I have the following structure /products/product-a and would like to pass on to the product in a segment to display quick view /products/product-a/quick-view There any way to use another template in runtime? Thanks
  15. Hi all, I have a situation in which a user can upload a file that's any one of a number of formats (pdf, mpg, jpg, etc.). If the file is an image, I want to do some resizing. However, when I call ->size(###,###) on the file field when an image is in it, I get an error. Makes sense. I'm hoping there's an easy way to solve this without needing to create a separate field for image uploads. I tried following @Soma's advice from this thread, but kept getting an error from ImageSizer saying I was passing in invalid format. I know the file in there is an image as it's getting displayed in the browser. So, is there a standard way to convert a File field to an Image field? Thanks.
  16. Just noticed the recent GitHub commit: and looks intriguing... Any chance of some sample code to illustrate how/where this might be used? Thanks in advance
×
×
  • Create New...