Jump to content

import pages by csv - how to create tags in page fields from this?


Go to solution Solved by SiNNuT,

Recommended Posts

Hi everyone,

i've build the recommended setup for processwire to work with tags, which means i have a page tree "Tags" and this page tree hold several title-only pages, each represents a tag. 

for the gallery items i like to tag, i've build a template with an categories field of the type "page", this template will be used by every item to hold the tags. the field is "free tagging" field, so it would create the tag-pages autmaticly.

now i need to import a csv file and this is where i have a problem:

when i'm using "the import pages by csv" module, i am not able to select the category field as csv target.

the tags column of my csv holds comma separated words as tag, so the schema looks like this:

PICTURE NAME     |    TAGS
----------------------------------
Some title       |   birds, unicorns, kittens
Another title    |   hearts, stars, pie

so i need to be able to select a page reference field as target for the TAGS column of the csv, and for every comma separated word i need to create a page tag automaticly and add this tag to the gallery item

i hope it's understandable what i like to do, otherwise feel free to let me explain it again 

Link to post
Share on other sites

This can be done since this update: http://processwire.com/blog/posts/processwire-core-updates-2.5.16/#set-page-references-from-title-string So you need to run at least version 2.5.16

Thank you for the hint.awesome stuff! But It seems the missing importPagesCSV is still needed:

So I updated the ImportPagesCSV module to support import of Page fields (to be posted soon)

Any news about this Ryan? :)
Link to post
Share on other sites

Funny you should post this I just shot off an email today to the maintainer of the website I built. So yes, you absolutely can import into a pagefield using the csv plugin. A page field is pretty much just the page path. So try this out, if you need to do tags using a pagefield it will look like this.


image   another_field      tag_field       tag_field     tag_field   tag_field
img.jpg  data                    tag path       tag path     tag path     tag path

if your tags are all in one place like siteroot/tags then your path will basically just be    /tags/tagname. Do this for every tag on one line. If you put your tags on different lines then they will just override the one before. 

**Edit I didn't read that you didnt have the tags created yet. You will need to create a csv of just tags first and make those before you try to link them, but that is nothing that 5 min in excel or your favorite spreadsheet program can't solve. 

Link to post
Share on other sites
  • Solution

Adding the page references via the csv module was/is allready possible:

https://processwire.com/talk/topic/383-module-import-pages-from-csv-file/page-4#entry21476. And now apparently also via titles, as LostKobrkai points out.

But i think you also want to create the tag pages (under a different parent) on the fly with this module. I'm not sure but i don't think this is possible.

A solution would be to grab all the unique tags from your csv and import the tags seperately. Ah, MuchDev already said it.

After that import the gallery items with the page (tag) references like above link.

  • Like 1
Link to post
Share on other sites

thank's a lot SiNNuT !

also it would be even nicer just reference tag names instead of ID's, i'm happy that it's doable like descriped on the post behind your helpfull link  :)))

Link to post
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
  • 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 Rodd
      Hi everyone!
      I have a website in a production environment and I want to duplicate it in a local environment. I exported the content of the website (with the 'Site Profile Exporter' module) but I cannot use it actually. I've got an issue with the database. I imported this one in MAMP then.

      I also exported the pages (with the 'ProcessPagesExportImport' module), but I cannot import it to my local website because the fields don't exist. So I created this fields, but I have this error :
      How can I use the elements that already exist and are presents in my database? How can I duplicate correctly the templates, fields and pages?
      Thanks by advance
      PS: Sorry if my english is bad
       
    • By hellerdruck
      Hi all
      I need help with something. Situation: We have let's say 2'000 Files (Excel) that should be displayed (list with links) on a page. We'd need to filter these files by given Keywords or a tree structure or both. Now, I'm looking for a solution whereas our customer can synchronise the files from his local computer with the folder on the webserver. They will update and upload files on a daily basis. Therefore, it would need to synchronise rather than load the files manually in pages or repeaters. Maybe indexing would be an idea, too.
      Are there any modules for Processwire that would help achieving this? Could anyone point me in the right direction?
      Thanks in advance.
    • By iNoize
      Hello, need some help for an RealEstate project. It have to use the OnOffice to import the objects. 
      https://apidoc.onoffice.de/
       
    • By Robin S
      Displays image tags overlaid on the thumbnail using customisable colours. This makes it easier to see which images have which tags without needing to open the edit pane for individual images or changing to the list view.
      Screenshot

      Usage
      Enable tags for one or more image fields. Install the Image Thumbnail Tags module. Optionally configure colours for any of your tags.
       
      https://github.com/Toutouwai/ImageThumbnailTags
      https://modules.processwire.com/modules/image-thumbnail-tags/
×
×
  • Create New...