Jump to content

Help Setting Up Input for Tabular Data Output?


John W.
 Share

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

Link to comment
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
Link to comment
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
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

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Similar Content

    • By Vineet Sawant
      Hi,
      I'm trying to import some heavy data into Processwire, but I'm not sure what would be the best way to do it.
      Usually I use CSV to Pages plugin, but this time the data is too heavy(~40k rows with 10+ columns of excel sheet), thus this plugin can't help.
      I also tried Tasker plugin but I can't seem to go through the setup itself, it requires some template setup but I'm totally clueless about how to do it, so that plugin is not of any use either.
      I wanted to know from you guys how you do it and in future what would be the best way to migrate thousands of rows of data in to PW.
       
      Thanks.
       
       
    • 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
      Hello,
       
      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
      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. 
      Organization
      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.
      Article
      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
×
×
  • Create New...