Jump to content
bernhard

RockGrid - powerful, performant and beautiful data listing tool

Recommended Posts

Earlier in this topic I asked about autoHeight for rows. Now I have created a nice and only slightly hacky solution for it (no hacks in libs, just working around stuff). The existing simple option is not acceptable in our use case, because even the official docs say:

Quote

For large data grids (eg 10,000+ rows) the time taken to calculate the heights may take to long and you may decide not to use the feature in these circumstances. The row limit depends on your browser choice, computer speed and data so you will need to decide for yourself how much data is to much for this feature.

When using autoHeight for 35k rows, I got twice the message "the web page seems to be running slow, do you want to stop it". I don't even dare to imagine what would happen on an old smartphone.

The obvious (to me) solution was to calculate automatic height on demand only for the handful of rows displayed at a time. This has to happen on page load, on filtering and on pagination navigation. Due how pagination is implemented, a hoop had to be jumped through with it as well (to avoid an infinite loop). To be clear: the ag-Grid API offered no immediately useful event I could listen to! viewportChanged sounded like it would work, but in practice it failed to cover page navigation.

var paginationAttached = false;
var paginationHandler = function (event) { rowHeighter(grid, event); }
function rowHeighter(grid, event) {
    // calculate row height for displayed rows to wrap text
    var cols = [ grid.gridOptions.columnApi.getColumn("code"), grid.gridOptions.columnApi.getColumn("variation") ];
    grid.gridOptions.api.getRenderedNodes().forEach(function(node) {
        node.columnController.isAutoRowHeightActive = function() { return true; };
        node.columnController.getAllAutoRowHeightCols = function() { return cols; };
        node.setRowHeight(grid.gridOptions.api.gridOptionsWrapper.getRowHeightForNode(node));
    });
    
    // if listening to paginationChange, onRowHeightChanged creates an infinite loop, so work around it
    if(paginationAttached === false) {
        grid.gridOptions.api.onRowHeightChanged();
        grid.gridOptions.api.addEventListener('paginationChanged', paginationHandler);
        paginationAttached = true;
    } else {
        grid.gridOptions.api.removeEventListener('paginationChanged', paginationHandler);
        grid.gridOptions.api.onRowHeightChanged();
        grid.gridOptions.api.addEventListener('paginationChanged', paginationHandler);
    }
}

You can see here that I had to brute-force overwrite a couple of functions in the ag-Grid row height calculation logic. I define the columns I want to target for the auto height and trick the getAllAutoRowHeightCols to just provide them.

My filter event listener in RockGridItemAfterInit is

grid.gridOptions.api.addEventListener('filterChanged', function(event) { rowHeighter(grid, event); });

A CSS rule is also required:

div[col-id="variation"].ag-cell, div[col-id="code"].ag-cell {
    white-space: normal;
}

Using automatic row heights brought about an issue with the default fixed height grid: a wild scrollbar appeared! I found out I can make the grid height adapt, putting this into RockGridItemBeforeInit:

// pagination with a fixed number of rows and adapting grid height
grid.gridOptions.paginationAutoPageSize = false;
grid.gridOptions.paginationPageSize = 15;
grid.gridOptions.domLayout = 'autoHeight';

Then I decided the pagination controls should live above the grid, because otherwise their position will change annoyingly whenever the grid height changes. Putting this into RockGridItemAfterInit:

// move the pagination panel to the top, because the dynamic row heights would change its position at the bottom
var pagingPanel = document.querySelector('.ag-paging-panel');
var rootWrapper = document.querySelector('.ag-root-wrapper');
rootWrapper.prepend(pagingPanel);

 

  • Like 2

Share this post


Link to post
Share on other sites

Thx for sharing that @Beluga! Do you think the aggrid core team could be interested in your solution? Maybe they can implement it somehow?

  • Like 1

Share this post


Link to post
Share on other sites
9 minutes ago, bernhard said:

Thx for sharing that @Beluga! Do you think the aggrid core team could be interested in your solution? Maybe they can implement it somehow?

I just now went looking in their issue trackers and found this in their enterprise support tracker (in category tab "Standard Feature Requests):

AG-1202 Allow rendering rows dynamically adapting their height to their content

That does sound like what I want, but thanks to their closed system, we have no way of knowing the exact contents of the issue! 💀👹😡

There is also this, which would only be for paying customers:

Enterprise Row Model AG-1039 Allow dynamic row heights and maxBlocksInCache

This is in Parked category:

AG-2228 Allow lazy loading of rows when using autoHeight, ie on scroll to configured amount of rows, append n more rows at the bottom

So looks like this stuff is on their radar (which I would have assumed based on how they acknowledge the pain point in their docs). Let's wait and see and for now enjoy my hack 😄 All this hacking does have the effect of improving my self-confidence and wanting to learn JS more deeply 🙂

  • Like 2

Share this post


Link to post
Share on other sites

Hi

I discovered ag-grid documentation (since I solved all my Rockfinder problems, thanks!). I have really general questions.

  • How I should decide what to put in BeforeInit vs AfterInit? For example, why the visible/hidden column are in AfterInit?
  • I want to have a modified version of YesNo plugin. How I can do that? For now, I rename with a slightly different name and add it in /assets/Rockgrid folder. Is it the good way to do it (it works BTW)?
  • Where I should put CSS file? I added in /assets/Rockgrid/style.css and link into my PHP file. However, for some reasons, I'm not able to use row classes. The class is well added in html but CSS classes's are overridden. However If I used instead inline CSS directly in the JS file, the row is correctly styled.
  • I have many Rockgrid fields, sharing some columns. How I can define some common column headers (definition, style, etc..) instead of re-write on each field.js file?

Thanks!

Mel

Share this post


Link to post
Share on other sites
7 hours ago, mel47 said:

How I should decide what to put in BeforeInit vs AfterInit? For example, why the visible/hidden column are in AfterInit?

Usually it's fine to put everything in BeforeInit. Sometimes AfterInit is needed (for example if you have dynamic columns calculated on runtime).

7 hours ago, mel47 said:

I want to have a modified version of YesNo plugin. How I can do that? For now, I rename with a slightly different name and add it in /assets/Rockgrid folder. Is it the good way to do it (it works BTW)?

Yes, that's fine.

7 hours ago, mel47 said:

Where I should put CSS file? I added in /assets/Rockgrid/style.css and link into my PHP file. However, for some reasons, I'm not able to use row classes. The class is well added in html but CSS classes's are overridden. However If I used instead inline CSS directly in the JS file, the row is correctly styled.

CSS should be loaded automatically: https://github.com/BernhardBaumrock/FieldtypeRockGrid/tree/master/plugins#creating-custom-plugins; I don't know why your css classes are overwritten, sorry.

8 hours ago, mel47 said:

I have many Rockgrid fields, sharing some columns. How I can define some common column headers (definition, style, etc..) instead of re-write on each field.js file?

See the readme here https://github.com/BernhardBaumrock/FieldtypeRockGrid/tree/master/coldefs

And a very simple example https://github.com/BernhardBaumrock/FieldtypeRockGrid/blob/master/coldefs/fixedWidth.js

You can then just use col = RockGrid.colDefs.yourColdefName(col); in BeforeInit

Share this post


Link to post
Share on other sites
On 9/24/2018 at 4:04 PM, Beluga said:

I like RockGrid very much and the new smart filter is a really nice addition. I will look into paying you after we launch the site.

Thank you Beluga! Just received your generous donation 🙂 Really appreciated! Thx! Glad if it helped you for your project even if it seems that you switched to another library now?! Thank you for all your feedback and contributions to this project!

Share this post


Link to post
Share on other sites
2 hours ago, bernhard said:

Thank you Beluga! Just received your generous donation 🙂 Really appreciated! Thx! Glad if it helped you for your project even if it seems that you switched to another library now?! Thank you for all your feedback and contributions to this project!

Well, RockGrid and RockFinder are still essential to make it work with PW no matter which JS lib we use 🙂

I will look into donating to Tabulator next to cover all bases.

Regarding the earlier discussion about creating a module that makes RockGrid and Apex Charts talk to each other: I might look into it after my plate is cleared of various stuff (such as launching this proverb project).

  • Like 1

Share this post


Link to post
Share on other sites

The new rockfinder updates make it easy to extend grids:

Extending Grids

Sometimes several RockGrids are very similar and you don't want to duplicate your code. You can create one base file and include this file from others:

// trainings.php
$finder = new RockFinder([
  'template' => 'training',
  'sort' => 'from',
], [
  'first',
  'from',
  'to',
]);
$finder->addField('coach', ['title']);
$finder->addField('client', ['fullname']);

// trainings_booked.php
include(__DIR__.'/trainings.php');

$finder->setSelectorValue('client', $this->user); // only show trainings of current user
$finder->addField('done'); // add column to show if the training was completed

$this->setData($finder);

You can then create another file, for example trainings_available.php to show all trainings that are in the future and available for booking:

include(__DIR__.'/trainings.php');

$finder->setSelectorValue('from>', time());
$finder->setSelectorValue('client', null); // client must not be set -> means available for booking

$this->setData($finder);
  • Like 2

Share this post


Link to post
Share on other sites

Hi,

New problem but I'm quite sure it was not there before, but I don't know since when. I upgrade to last version 1.1.1 but didn't help. I get this error. The grids (more than 1 with different queries) appear with "loading" but nothing happens. Error is from Chrome, but same one in Firefox.

(index):2 Uncaught SyntaxError: Unexpected token W in JSON at position 1 at JSON.parse (<anonymous>) at XMLHttpRequest.xhr.onreadystatechange (RockGridItem.js?t=1550464515:271)

Thanks

 


 
 

Share this post


Link to post
Share on other sites
On 6/30/2018 at 5:38 PM, bernhard said:

Support: Please note that this module might not be as easy and plug&play as many other modules. It needs a good understanding of agGrid (and JavaScript in general) and it likely needs some looks into the code to get all the options. Please understand that I can not provide free support for every request here in the forum. I try to answer all questions that might also help others or that might improve the module but for individual requests I offer paid support for 60€ per hour (excl vat).

Hi mel47,

sorry to hear that. Check your finder with RockFinderTester, maybe it is somehow broken. If that does not work you can write me a PM support request and maybe provide a login to your system so that I can check what is going on. You need to make sure that the response of the AJAX requests are valid JSON. Also check all your error logs, maybe you find some helpful information there.

  • Like 1

Share this post


Link to post
Share on other sites
On 2/18/2019 at 12:01 AM, mel47 said:

Hi,

New problem but I'm quite sure it was not there before, but I don't know since when. I upgrade to last version 1.1.1 but didn't help. I get this error. The grids (more than 1 with different queries) appear with "loading" but nothing happens. Error is from Chrome, but same one in Firefox.

(index):2 Uncaught SyntaxError: Unexpected token W in JSON at position 1 at JSON.parse (<anonymous>) at XMLHttpRequest.xhr.onreadystatechange (RockGridItem.js?t=1550464515:271)

Thanks

 



 
 

Solved. Had to return in PHP7.1 because zlib is "on" instead of "off" on my server when set to PHP7.2.

 

Share this post


Link to post
Share on other sites

Just added support for tippy.js to show nice tooltips with additional information. For example here I needed to show all available invoices related to one project of one month and I don't want different line heights, so I show the links on hover:

ajvRWQQ.png

Using tippy.js

img

col = grid.getColDef('ids');
col.headerName = 'Rechnung';
col.cellRenderer = function(params) {
  if(!params.value) return '';
  var ids =  params.data.ids.split(',');
  var out = 'IDs: ' + ids.join(', ');
  var tippy = 'One per line:<br>' + ids.join('<br>');
  return RockGrid.tippy(out, tippy);
}
  • Like 6

Share this post


Link to post
Share on other sites

If I want to show tens of thousands of rows, but just 100 per page, the only options I have at the moment are:

  • Load all rows and let agGrid handle the pagination (fast navigation, slow initial load)
  • Just show 100 results (fast initial load, but data is incomplete)
  • implement my own server side ajax implementation for pagination (fast, but higher development effort)

Is that right? Or does RockFinder already provide a solution for pagination without having to load all the data? If it doesn't: Is that something that falls in the scope of RockFinder and you @bernhard would like it to be implemented?

Share this post


Link to post
Share on other sites

Hi @MrSnoozles

you are right - RockGrid is intended to load all data to the client at once. Doing this via paginated ajax calls would have a lot of side effects and is not planned. For example if you have column statistics showing the sum of all rows, that would not be possible when data was paginated (and not fully loaded into the grid). Also sorting would work totally different. aggrid supports this feature, but it would need a LOT more work to also support this in RockGrid. Not only for development of RockGrid but also for development of every single field/grid.

When I have complex queries then I usually display only a subset of the data, for example all entries of year XXXX. You can see some performance tests here:

 

 

  • Like 2

Share this post


Link to post
Share on other sites

Just had a very interesting conversation with @wbmnfktr and wanted to share this little preview of a quite big upgrade coming soon called "RockGridActions". I'll share some more infos soon. The great thing about it is that it is built modularly so that we'll be able to use it almost plug&play for RockTabulator ( @Beluga)

  • Like 14

Share this post


Link to post
Share on other sites

Imagine you have a nice conversation with someone and only a few hours afterwards you are knee-deep into a module and possibilities you never thought of. Thank you @bernhard for hijacking my plans for the weekend. 😉 

  • Like 6
  • Haha 1

Share this post


Link to post
Share on other sites

@bernhard Thanks for the great module! Just started to use in in a project and it has helped me save a ton of time!

Is it possible to create a grid just by PHP? Saw that there was a Javascript possibility but i would need to create grid from a form submit.

Share this post


Link to post
Share on other sites

Hi @gottberg

glad to hear that. Sometimes I feel that the potential of this or similar modules is underestimated. If you only need a HTML grid (table) then you might be better off using MarkupAdminDataTable. RockGrid is by design a grid with user input like filtering and sorting and custom colorizations based on cell values. If you don't need all that just create a plain html table.

Does that help?

Share this post


Link to post
Share on other sites
1 minute ago, bernhard said:

Hi @gottberg

glad to hear that. Sometimes I feel that the potential of this or similar modules is underestimated. If you only need a HTML grid (table) then you might be better off using MarkupAdminDataTable. RockGrid is by design a grid with user input like filtering and sorting and custom colorizations based on cell values. If you don't need all that just create a plain html table.

Does that help?

Thanks for fast reply! Well in this case i would want the export to csv which would be convenient since the project uses RockGrid for many of the listings. 🙂 I could save the form to a own template which would only be updated on submit, then i would get the export feature too 🙂

Share this post


Link to post
Share on other sites

Sorry, I don't get what you are saying 🙂 

BTW: Of course you can just show a simple grid without modifying it via javascript. That's explained in the quickstart: https://github.com/BernhardBaumrock/FieldtypeRockGrid/wiki/Quickstart (actually there is nothing to explain if you don't use any javascript modifications). But as soon as you want to style or tweak your grid (eg custom Headernames) you need javascript.

Would be happy to see some screenshots so maybe others do also get inspired by your work 😉 

Share this post


Link to post
Share on other sites
21 hours ago, bernhard said:

Sorry, I don't get what you are saying 🙂 

BTW: Of course you can just show a simple grid without modifying it via javascript. That's explained in the quickstart: https://github.com/BernhardBaumrock/FieldtypeRockGrid/wiki/Quickstart (actually there is nothing to explain if you don't use any javascript modifications). But as soon as you want to style or tweak your grid (eg custom Headernames) you need javascript.

Would be happy to see some screenshots so maybe others do also get inspired by your work 😉 

I meant that i would create a template to which the form would be submited so that i could use RockGrid as usual. I did that and i works great for this use! 🙂 

I would love to share but since its for the customers internal use im not allowed to share anything.. 😕

Once again thank you! 

Share this post


Link to post
Share on other sites
38 minutes ago, gottberg said:

I meant that i would create a template to which the form would be submited so that i could use RockGrid as usual. I did that and i works great for this use! 🙂 

Still don't get it. We have forms all over PW (and the web), so it's hard to guess which one you are talking about... and I have also no idea what you mean by using RockGrid "as usual" - but I'm curious: Are you using it on the Frontend?

Share this post


Link to post
Share on other sites
54 minutes ago, bernhard said:

Still don't get it. We have forms all over PW (and the web), so it's hard to guess which one you are talking about... and I have also no idea what you mean by using RockGrid "as usual" - but I'm curious: Are you using it on the Frontend?

Sorry, im bad at explaining. It's a backend module and i use RockGrid to display lots o different data. The data is loaded from PW.

The question i had from the beginning was if i could create a RockGrid with plain PHP. 

The module has a form that gets submited with data, and i wanted to create a RockGrid just with the POST data, that originally was not getting saved.

Now the data gets saved to a page and i can easily use RockGrid with that data.

Small offtopic question: Can i change the separator to comma somehow?

Thanks!

Share this post


Link to post
Share on other sites

Ok thx, now I get it 😉 I've planned that feature, but can't remember that I've ever used it, so I don't know if that still works (see option 2, InputfieldRockGrid.module.php):

7QtbN2e.png

1 hour ago, gottberg said:

Small offtopic question: Can i change the separator to comma somehow?

If you are talking about excel export: yes. I don't have any sample code, see /plugins/buttons/excel.js

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Robin S
      Repeater Images
      Adds options to modify Repeater fields to make them convenient for "page-per-image" usage. Using a page-per-image approach allows for additional fields to be associated with each image, to record things such as photographer, date, license, links, etc.
      When Repeater Images is enabled for a Repeater field the module changes the appearance of the Repeater inputfield to be similar (but not identical) to an Images field. The collapsed view shows a thumbnail for each Repeater item, and items can be expanded for field editing.
      Screencast

      Installation
      Install the Repeater Images module.
      Setup
      Create an image field to use in the Repeater field. Recommended settings for the image field are "Maximum files allowed" set to 1 and "Formatted value" set to "Single item (null if empty)". Create a Repeater field. Add the image field to the Repeater. If you want additional fields in the Repeater create and add these also. Repeater Images configuration
      Tick the "Activate Repeater Images for this Repeater field" checkbox. In the "Image field within Repeater" dropdown select the single image field. You must save the Repeater field settings to see any newly added Image fields in the dropdown. Adjust the image thumbnail height if you want (unlike the core Images field there is no slider to change thumbnail height within Page Edit). Note: the depth option for Repeater fields is not compatible with the Repeater Images module.
      Image uploads feature
      There is a checkbox to activate image uploads. This feature allows users to quickly and easily add images to the Repeater Images field by uploading them to an adjacent "upload" field.
      To use this feature you must add the image field selected in the Repeater Images config to the template of the page containing the Repeater Images field - immediately above or below the Repeater Images field would be a good position.
      It's recommended to set the label for this field in template context to "Upload images" or similar, and set the visibility of the field to "Closed" so that it takes up less room when it's not being used. Note that when you drag images to a closed Images field it will automatically open. You don't need to worry about the "Maximum files allowed" setting because the Repeater Images module overrides this for the upload field.
      New Repeater items will be created from the images uploaded to the upload field when the page is saved. The user can add descriptions and tags to the images while they are still in the upload field and these will be retained in the Repeater items. Images are automatically deleted from the upload field when the page is saved.
      Tips
      The "Use accordion mode?" option in the Repeater field settings is useful for keeping the inputfield compact, with only one image item open for editing at a time. The "Repeater item labels" setting determines what is shown in the thumbnail overlay on hover. Example for an image field named "image": {image.basename} ({image.width}x{image.height})  
      https://github.com/Toutouwai/RepeaterImages
      https://modules.processwire.com/modules/repeater-images/
    • By EyeDentify
      Hello There Guys.

      I am in the process of getting into making my first modules for PW and i had a question for you PHP and PW gurus in here.

      I was wondering how i could use an external library, lets say TwitterOAuth in my PW module.
      Link to library
      https://twitteroauth.com/

      Would the code below be correct or how would i go about this:
      <?PHP namespace ProcessWire; /* load the TwitterOAuth library from my Module folder */ require "twitteroauth/autoload.php"; use Abraham\TwitterOAuth\TwitterOAuth; class EyeTwitter extends WireData,TwitterOAuth implements Module { /* vars */ protected $twConnection; /* extend parent TwitterOAuth contructor $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $access_token, $access_token_secret); */ public function myTwitterConnection ($consumer_key, $consumer_secret, $access_token, $access_token_secret) { /* save the connection for use later */ $this->twConnection = TwitterOAuth::__construct($consumer_key, $consumer_secret, $access_token, $access_token_secret); } } ?> Am i on the right trail here or i am barking up the wrong tree?
      I don´t need a complete solution, i just wonder if i am including the external library the right way.
      If not, then give me a few hint´s and i will figure it out.

      Thanks a bunch.

      /EyeDentify
    • By dimitrios
      Hello,
      this module can publish content of a Processwire page on a Facebook page, triggered by saving the Processwire page.
      To set it up, configure the module with a Facebook app ID, secret and a Page ID. Following is additional configuration on Facebook for developers:
      Minimum Required Facebook App configuration:
      on Settings -> Basics, provide the App Domains, provide the Site URL, on Settings -> Advanced, set the API version (has been tested up to v3.3), add Product: Facebook Login, on Facebook Login -> Settings, set Client OAuth Login: Yes, set Web OAuth Login: Yes, set Enforce HTTPS: Yes, add "http://www.example.com/processwire/page/" to field Valid OAuth Redirect URIs. This module is configurable as follows:
      Templates: posts can take place only for pages with the defined templates. On/Off switch: specify a checkbox field that will not allow the post if checked. Specify a message and/or an image for the post.
      Usage
      edit the desired PW page and save; it will post right after the initial Facebook log in and permission granting. After that, an access token is kept.
       
      Download
      PW module directory: http://modules.processwire.com/modules/auto-fb-post/ Github: https://github.com/kastrind/AutoFbPost   Note: Facebook SDK for PHP is utilized.


    • By kongondo
      FieldtypeRuntimeMarkup and InputfieldRuntimeMarkup
       
      Modules Directory: http://modules.processwire.com/modules/fieldtype-runtime-markup/
      GitHub: https://github.com/kongondo/FieldtypeRuntimeMarkup
      As of 11 May 2019 ProcessWire versions earlier than 3.x are not supported
      This module allows for custom markup to be dynamically (PHP) generated and output within a page's edit screen (in Admin).
       
      The value for the fieldtype is generated at runtime. No data is saved in the database. The accompanying InputfieldRuntimeMarkup is only used to render/display the markup in the page edit screen.
       
      The field's value is accessible from the ProcessWire API in the frontend like any other field, i.e. it has access to $page and $pages.
       
      The module was commissioned/sponsored by @Valan. Although there's certainly other ways to achieve what this module does, it offers a dynamic and flexible alternative to generating your own markup in a page's edit screen whilst also allowing access to that markup in the frontend. Thanks Valan!
       
      Warning/Consideration
      Although access to ProcessWire's Fields' admin pages is only available to Superusers, this Fieldtype will evaluate and run the custom PHP Code entered and saved in the field's settings (Details tab). Utmost care should therefore be taken in making sure your code does not perform any CRUD operations!! (unless of course that's intentional) The value for this fieldtype is generated at runtime and thus no data is stored in the database. This means that you cannot directly query a RuntimeMarkup field from $pages->find(). Usage and API
       
      Backend
      Enter your custom PHP snippet in the Details tab of your field (it is RECOMMENDED though that you use wireRenderFile() instead. See example below). Your code can be as simple or as complicated as you want as long as in the end you return a value that is not an array or an object or anything other than a string/integer.
       
      FieldtypeRuntimeMarkup has access to $page (the current page being edited/viewed) and $pages. 
       
      A very simple example.
      return 'Hello'; Simple example.
      return $page->title; Simple example with markup.
      return '<h2>' . $page->title . '</h2>'; Another simple example with markup.
      $out = '<h1>hello '; $out .= $page->title; $out .= '</h1>'; return $out; A more advanced example.
      $p = $pages->get('/about-us/')->child('sort=random'); return '<p>' . $p->title . '</p>'; An even more complex example.
      $str =''; if($page->name == 'about-us') { $p = $page->children->last(); $str = "<h2><a href='{$p->url}'>{$p->title}</a></h2>"; } else { $str = "<h2><a href='{$page->url}'>{$page->title}</a></h2>"; } return $str; Rather than type your code directly in the Details tab of the field, it is highly recommended that you placed all your code in an external file and call that file using the core wireRenderFile() method. Taking this approach means you will be able to edit your code in your favourite text editor. It also means you will be able to type more text without having to scroll. Editing the file is also easier than editing the field. To use this approach, simply do:
      return wireRenderFile('name-of-file');// file will be in /site/templates/ If using ProcessWire 3.x, you will need to use namespace as follows:
      return ProcessWire\wireRenderFile('name-of-file'); How to access the value of RuntimeMarkup in the frontend (our field is called 'runtime_markup')
       
      Access the field on the current page (just like any other field)
      echo $page->runtime_markup; Access the field on another page
      echo $pages->get('/about-us/')->runtime_markup; Screenshots
       
      Backend
       

       

       
      Frontend
       

×
×
  • Create New...