Jump to content
John W.

Help Setting Up Input for Tabular Data Output?

Recommended Posts

I'm working on a site where I need to output data for a table. I looked at the Matrix plugin, but, I don't think it does exactly what I want...since my particular table is split into colspans i.e. Direct, Maternal, Carcass, and $Index

An example of the table output is attached.

I've pondered using 3 repeaters for the first column titled, EPD, Acc and %Rank.  Each one of these repeaters would have the fields for CE, BW, WW, YW, MCE....

The last thing I want is to have to create a very long list of inputs vertically down the page for each field in the back-end for my client.

Any PW gurus here, maybe help me out? If there is absolutely, no alternative to make input simple for my client, let me know if I have to buy ProFields.

thanks mucho!


Screen Shot 2017-08-09 at 4.17.34 PM.png

Share this post

Link to post
Share on other sites

hi, could be a perfect fit for my Handsontable module: 

if the headers are always the same you could just set them up in your field settings.

the problems with my module are that the field will not be queryable (does that word exist?) and that it is currently not easily possible to add columns to the field lateron since the field settings will change but the data stored in the field will not. if that's no problem for you it could be worth a try ;)

@szabesz the datatables module is more for presentation inside the admin, not for input

  • Like 2

Share this post

Link to post
Share on other sites

I read "I need to output data for a table" so input did not occurred to me, but I might be totally wrong. Sorry for that. Besides, I forgot the name of this other table module of yours (Handsontable). Thanks for reminding us :)



Edited by szabesz
fix in the text
  • 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.

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 Sipho
      I am trying to create a sort of database system using ProcessWire. I don't want all the data to show up as pages on the website but instead pull it into pages. Similar to the Skyscrapers demo except in that one the data shows up as pages. The data I wish to store is information about types of moths. So family, sub-family, genus and species. Each of these has information associated with it. For example, species has name, images and distribution. This is another example of information about the species. Initially, I attempted to do this using nested repeaters. This appears to work but I feel there is a better and more elegant way. Additionally, this page says: 
      So I then tried using pages with children, but this also didn't work well. I had to make every single page unpublished as I don't want them showing up in menus and other places. This means they all have strikethroughs in the admin tree which is very annoying.
      Is there a better way of handling this kind of data in ProcessWire or is this maybe not a suitable project for ProcessWire? I apologise if this is a silly question, but I could not find anything on this matter and am still new to ProcessWire.
    • By Harmen
      I want to put some data in a table field, but if I put the label of the first table field, it gives an error:  Item 'feature' set to TableRows is not an allowed type
      Here is my code:
      foreach ($fetchAll as $fetch => $feature) { $productid = $feature["id_product"]; $pages = wire("pages")->get("productid=$productid"); $pages->of(false); // ensure output formatting is off $pages->Specification->feature = ($feature['name']); $pages->Specification->value = ($feature['value']); $pages->save(); } I tried to give the label other names, but it still doesn't work. How can this be solved?
    • By AndZyk
      As a web developer I always want to improve the search results of my websites in popular search engines. Because of that I find the topic of structured data very interesting and want to learn more about them. Recently I tried out a few of the ways how to provide more information to a website and want to share my solutions. Most of the structured data can be included directly in the markup or as JSON-LD at the end of your document (right before the closing body tag). I prefer the last one, because I don't like to have bloated HTML markup.
      Breadcrumbs are an alternative way to show the your page hierarchy inside search results, instead of showing just the plain URL. Just like the breadcrumbs on a website. Following the example, I ended up with this code:
      <?php if(strlen($page->parents()) > 0) { ?> <!-- Breadcrumbs --> <script type="application/ld+json"> { "@context": "http://schema.org", "@type": "BreadcrumbList", "itemListElement": [ <?php $positionCounter = 1; $separator = ','; foreach($page->parents() as $parent) { if($parent->id == $page->parents()->last()->id) { $separator = ''; } echo ' { "@type": "ListItem", "position": "' . $positionCounter . '", "item": { "@id": "' . $parent->httpUrl . '", "name": "' . $parent->title . '" } }' . $separator . ' '; $positionCounter++; } ?> ] } </script> <?php } ?> First I am checking if the page has parents, then I follow the follow the markup of the example. I save the position of each parent in the variable positionCounter and increase its amount after each loop. As a last step I tried to end the JSON objects by not include the separating comma after the last object. This is why I am using the separator variable.
      Site name and sitelinks searchbox
      Using JSON-LD you can provide an alternative site name and a sitelinks searchbox inside the search results (Inception  ).
      <!-- WebSite --> <script type="application/ld+json"> { "@context": "http://schema.org", "@type": "WebSite", "name" : "Your site name", "alternateName" : "Your alternative site name", "url": "<?= $pages->get(1)->httpUrl ?>", "potentialAction": { "@type": "SearchAction", "target": "<?= $pages->get(1)->httpUrl ?>search/?q={search_term_string}", "query-input": "required name=search_term_string" } } </script> I am not 100% sure, if the sitelinks searchbox works this way. Maybe someone who made this work before could confirm it, that would help me out. 
      For organizations you could provide a logo and links to your social profiles.
      <!-- Organization --> <script type="application/ld+json"> { "@context": "http://schema.org", "@type" : "Organization", "name" : "Your organization name", "url" : "<?= $pages->get(1)->httpUrl ?>", "logo": "<?= $pages->get(1)->httpUrl ?>site/templates/images/logo.png", "sameAs" : [ "https://www.facebook.com/your-organization-url", "https://www.instagram.com/your-organization-url/" // All your social profiles ] } </script> This one I think is self explanatory.
      If you have an blog or a news site you could enhance your articles with structured data with an thumbnail and author.
      <?php if($page->template == "post") { ?> <!-- Article --> <script type="application/ld+json"> { "@context": "http://schema.org", "@type": "NewsArticle", "mainEntityOfPage": { "@type": "WebPage", "@id": "<?= $page->httpUrl ?>" }, "headline": "<?= $page->title ?>", "image": { "@type": "ImageObject", "url": "<?= $page->thumbnail->httpUrl ?>", // Image field in template "height": <?= $page->thumbnail->height ?>, "width": <?= $page->thumbnail->width ?> }, "datePublished": "<?= date('c', $page->created) ?>", "dateModified": "<?= date('c', $page->modified) ?>", "author": { "@type": "Person", "name": "<?= $page->createdUser->first_name . ' ' . $page->createdUser->last_name ?>" // Text fields added to core module ProcessProfile }, "publisher": { "@type": "Organization", "name": "Your organization name", "logo": { "@type": "ImageObject", "url": "<?= $pages->get(1)->httpUrl ?>site/templates/images/logo.png", "width": 244, // Width of your logo "height": 36 // Height of your logo } }, "description": "<?= $page->summary ?>" // Text field in template } </script> <?php } ?> Here I am enabling structured data for the template called post. I also have the text fields first_name and last_name added to the core module ProcessProfile, the image field thumbnail and the text field summary added to the template.
      Just a small note: I know you could use $config->httpHost instead of $pages->get(1)->httpUrl, but I found the second one more flexibel for changing environments where you have for example HTTPS enabled.
      Those are the structured data I have in use so far. I hope I haven't made a mistake, at least the testing tool doesn't complain. But if you find something, please let me know. I love how easy it is with ProcessWire to get all the information from various pages and use them in this context.
      As mentioned above, I am nowhere an expert with structured data, but maybe some of you would like to provide also some examples in this thread. 
      Regards, Andreas
    • By gebeer
      Hi Folks,
      I am currently building an angular app for creating and displaying polls/surveys: http://embed.plnkr.co/seQfprxQRvjg84bvi2Dy/
      The data that needs to be stored in PW comes from JSON and looks like
      { "title": "My Survey", "questions": [ { "id": 1, "title": "First Question", "answers": [ { "id": 1, "title": "Answer 1" }, { "id": 2, "title": "Answer 2" } ] } ], "file": { "$ngfName": "long-beach-koh-payam.jpg", "$ngfOrigSize": 351901, "$ngfBlobUrl": "blob:http://localhost:8000/8b87de97-549a-4900-8579-71a0d87a9258" } } Now I need to decide how to best store that data with PW. I am also using Angular to build the forms where users can submit the poll from the JSON that is produced by the survey builder. So I would like to create 1 page per poll. The template holds title field, an image file field and one field that stores the data as JSON string.
      To me this seems an easier approach than having child pages for each question in the poll and again child pages for each answer to a question.
      Do you see any disadvantages that this approach might bring?
      And which field type should I use to store the JSON string, textarea?
    • By mrjasongorman
      Hi all! this is more of a general MYSQL Schema discussion but i noticed that PW does a pretty good job of handling flexible objects (pages) by creating a new table for each object property (field).
      I was wondering what other options there are out there for storing flexible but efficient objects in MYSQL.
      I noticed that Wordpress uses it's wp_postmeta table extensively for storing flexible schema.
      Also according to Facebooks engineering there's a simplified schema overview of it's TAO based system that uses MYSQL as it's underlying datastore for it's graph data. (https://www.facebook.com/notes/facebook-engineering/tao-the-power-of-the-graph/10151525983993920)
      So as i say i was just curious really as to different setups and indexing options anyone has used to be able to handle flexible objects within MYSQL.
  • Create New...