Powergrid CsV and PHP

Is it possible to run a php script from the cell of a CSV file using PowerGrid CSV

ie.

The spreadsheet used to create the CSV file, looks like

Agro - Free Watch Competition 1992 3 sticker - KRA01 /kraft/kraft-info/kraft-get-info.php

ALL SORTED THANKS

Can anyone advise me please.

David

Sorry. You cannot add PHP code directly into a CSV cell. However, there is the PG Import stack that allows you to import stacks (which could contain PHP) into a cell.

Thanks Joe

Do you have a video of this one?

David

I do not have a video it seems. Its super simple though…

27

you put in an Import ID into the PG Import stack. Then you use the sample macro above it and place that inside of your CSV file.

Thanks Joe

I will have a look at the PG Import but I think I am painting myself in to a corner. My tables are fairly static so I might end up changing tack and create my own tables.

David

Hi Joe

Sorry but it is not super simple to my limited RW skills. Where do I put the PG Import Stack?

David

You should be able to put ti anywhere you want on the page. But I have had a pretty long day and my brain is not fully functional. LOL

Think I have worked some of it out. Can you explain the macro and importID bit>

David

You set the ID inside of the import stack settings. Then you place the macro with the id inside of your CSV file. So if your ID was “code”, then your macro would be “%pgimport(code)%”

Wherever you place that macro, you will get the data from the PG Import stack.

Thanks Joe

Think I gat a grasp of the method now.

PS.

I still get this error message in RW 8.6.1 with the latest Stacks update. Does not seem to affect the published site though.

David

David

1 Like

Tearing my hair out Joe. Its got me buggered.

  1. Is this correct. I have also tried PG Import and PowerGrid CSV NOT embedded.

  1. Properties

  1. In numbers

  1. Web output

worked it out. Ignore last message. Thanks heaps Joe.

1 Like
  • Inside PG Import, put an image. Take out the PowerGrid stack and put it where you want the table to be
  • then set the id to image in the PG Import stack
  • In a cell of your CSV, insert the following… %pgimport(image)%

This should give you an idea on how to implement it.

Really love this method Joe. Works like a dream. I know I need to data base everything the the time it would take……

One more question. Is it possible to hide columns? ie the spreadsheet has 7 columns and I only want to display 6.

David

Its not possible out of the box to hide a column. I could probably give you some CSS that could do the job though. Got a URL?

Thanks for your reply, Joe

Before I put you to a lot of trouble, Joe, even setting a max number of columns would help. It would be just a matter of re-ordering my columns so that the “hide” columns are after theMAX CoL.

Looking forward to your PHP recording.

David

Why not just delete the columns you dont need from the CSV?

Because my php script uses data in the other columns based on the index. Don’t worry about it joe. Easy enough to set up as two tables. Just looking fir the easy way out. Thanks fir your help again.

David

Regards David
0404 499 979

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.