Jump to content

Display custom content in otherwise empty FieldsetTab?


hellomoto
 Share

Recommended Posts

I have a fieldsettab I want to populate with two collapsable fields that are for display not input. One will display data directly from an extra MySQL table (corresponding with PW pages) and the other will list certain PW pages. How do I go about this? I wanted to lay them out using Dynatable, one per each field. Thanks.

Link to comment
Share on other sites

One approach is to use InputfieldMarkup. I wrote a Fieldtype which displays any markup related to the field settings or template settings. Feel free to use it. You can easily include your stuff via iframe. Another approach is to hook in your tab.

FieldtypeMarkup.zip

Link to comment
Share on other sites

  • 3 weeks later...

Lost I tried having it run this file 

<?php namespace ProcessWire; ?>

<script src="https://cdnjs.cloudflare.com/ajax/libs/Dynatable/0.3.1/jquery.dynatable.min.js"></script>

<?php

$q = wire('database')->query('SELECT * FROM cc_vpv WHERE id = ' . wire('page')->id);
echo 'Pageviews= ';
print_r($q);

 ?>

unsuccessfully, I know I'm probably just doing something wrong.

kixe why isn't yours in the Modules directory? I'll give it a go, thanks guys.

Link to comment
Share on other sites

On 6/6/2017 at 6:10 AM, LostKobrakai said:

There's also this, if you don't want to create your own module: 

 

Okay I need one that allows PHP so that I can display data directly from MySQL. Lost, do you know how can I work yours correctly, considering what I've already attempted? 

Link to comment
Share on other sites

The docs in the module thread are quite well written, just use them. You can quite simply use php in there, as that's the whole purpose of it. Just make sure to return a html string like it's done in the various examples.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...