closed Adding Multiple TXT files to a Blog post

alt=
@jrblack1175
4 years ago
26 posts
I am still working through moving posts from my old phpbb site to Jamroom. I had an attachments module on my phpbb site.
I have updated the form designer to allow for a file attachment, and which type of files. I can see the file if I go edit the blog post, but to just view the blog post - the file isn’t there. I’m assuming it requires a change to the blog template (I’m using the Elastic 2 skin), but I have 0 clue... Seems silly that you can add a file to something and not be able to view it. Also wondering whether there’s a way to upload multiple files.
We don’t do audio files or video files... We use it to house stories. Sometimes stories have multiple chapters and instead of having 15 posts, I’d like to have 1 post with 15 files.
updated by @jrblack1175: 04/25/20 08:39:17AM
nate
@nate
4 years ago
911 posts
You might want to try a .pdf instead of txt files. That way the format is consistent and pdf files are broadly supported and have a universal appearance. You can also make it just one file with pages.
updated by @nate: 04/21/20 07:39:18AM
alt=
@jrblack1175
4 years ago
26 posts
Ok, I'm fine with that. I just want to be able to post files to a blog and see that they're there? PDF, TXT, HTML, I'm not picky. Right now, I can enable the file upload option on the form, but no one can view that there's a file. And I can't figure out whether people could add more than one file...if I could somehow get the file list to show up - once uploaded.

So, to recap, I can adjust the form. Upload the file. That all works. When I go to the blog post, no file is seen. When I EDIT the blog post, the file is there, but when I save it again, no file can be viewed / seen.
brian
@brian
4 years ago
10,144 posts
Yeah this requires you to customize your jrBlog/templates/item_detail.tpl file and add in the custom form field you've created in the form designer.

What is the name of the custom file upload field you added?


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
alt=
@jrblack1175
4 years ago
26 posts
Let me check...

file upload: blog_attachment

I know I'm looking a gift horse in the mouth, but is there any way to add multiple files? I mean, seems like the functionality should exist if one can upload multiple images into a gallery...

Here's what I'm attempting to replicate / move: https://blissfulignorance.com/phpBB3/viewtopic.php?f=24&t=2648
brian
@brian
4 years ago
10,144 posts
Yep - Jamroom supports as many different file uploads as you want - i.e. you can have 50 txt files attached to an item no problem. What I am not sure of though is if that is supported when using the Form Designer. File uploads are little more tricky in that they have to do more prep work in the form to make sure the back end is ready to "accept" the files that might be uploaded.

I'll check on that and let you know if it is supported or not - if not, it's something we can probably get in the next beta.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
paul
@paul
4 years ago
4,325 posts
You can add file upload fields to the create and update forms for any Jamroom item using the Form Designer. Unfortunately uploading multiple files in one field isn't an option. However, you can add multiple 'single file' fields.

I've tried this on my test site and added two blog file fields to the blog create form. These are 'blog_file1' and 'blog_file2'. See the attached screenshot.

When adding new fields to a form, you will then need to edit the appropriate template(s) to show those new fields. This cannot happen automatically as Jamroom has no knowledge what users might want to add, or where in the item view they want that info to show.

After adding these file fields, this is the code I added to the blog 'item_detail.tpl' template to show the uploaded files and allow their download -

{if jrCore_checktype($item.blog_file1_size, 'number_nz')}
    Download '{$item.blog_file1_name}': <a href="{$jamroom_url}/{$murl}/download/blog_file1/{$item._item_id}/{$item.blog_file1_name|jrCore_url_string}">{jrCore_file_type_image extension=$item.blog_file1_extension width=32 height=32 alt="`$alt` `$item.blog_file1_name`" class="download_img"}</a><br>{/if}
{if jrCore_checktype($item.blog_file2_size, 'number_nz')}
    Download '{$item.blog_file2_name}': <a href="{$jamroom_url}/{$murl}/download/blog_file2/{$item._item_id}/{$item.blog_file2_name|jrCore_url_string}">{jrCore_file_type_image extension=$item.blog_file2_extension width=32 height=32 alt="`$alt` `$item.blog_file2_name`" class="download_img"}</a><br>{/if}

See second screenshot for how it looks on the detail page. You can show other uploaded file data if needed - use the smarty debug to see what blog parameters are available to the template.

Hope this helps


--
Paul Asher - JR Developer and System Import Specialist
nate
@nate
4 years ago
911 posts
Make sure you're using the template editor to make these changes in the item_detail.tpl. Otherwise, you could lose your edits when and if a module update comes out.
alt=
@jrblack1175
4 years ago
26 posts
Awesome. I'll go give this a shot. So, to be clear, I can add up to 50 individual fields to upload files? I wonder what that will look like... Most times, people would post A file and then come back and add another file; I'd need to make sure they didn't accidentally replace the prior file. Hmmmmm...

We'll work through this one step at a time. First thing is to get the blog post to display with the file attachment, so I'll work through @Paul's comments and yours @Nate, re: tpl file... (note to self: back up tpl file before messing with it).

Then I can sort though multiple file uploads. My question is, though, if I add let's say 5 fields because the likelihood of someone needing more than 5 at a time isn't high, and then it has 5 fields in the Edit form... If they try to add 1 file, does that replace one of the 5 or would that add to the 5? Or would I need to sort it out like 5 in the NEW and then 20 in the EDIT... Is anyone able to follow my logic here, just thinking through step-wise. Because right now, all I see is 1 field, so 1 file. But, wouldn't 5 fields mean only 5 files, so there's no "add" function...

I'm sure I'm just confusing people, but if someone can understand the ask, let me know... I'll work on the template updating.
THANK YOU!!!
brian
@brian
4 years ago
10,144 posts
Are you really wanting to use a blog format for this? What about a forum like you see here? Jamroom has a full forum module that might be a better solution for importing from a phpBB3 forum. Just an idea...


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
alt=
@jrblack1175
4 years ago
26 posts
There's still no file upload on the Forum interface, though. I checked.

So, basically, what I'm thinking is that I'll make a Featured Authors group that will post via blog and then have a forum for people to post their stories and have discussions, etc.

That still means that the file uploading would need to go in the Blog section.

But going back to the importing forum thing - would porting my phpbb3 forum to jamroom bring over the attachments into the posts - as they are today?
paul
@paul
4 years ago
4,325 posts
Any import like this is going to require preliminary and custom work, but we do have tools to import data once this work is done. Checkout our Exporter and Importer modules. Documentation here and on subsequent pages - https://www.jamroom.net/the-jamroom-network/documentation/importing-merging-sites-to-jamroom/4725/overview

Basically, you would need to create a CSV file using a dump of your phpBB3 database which would be customised to the format specified in the above documentation's appendix. The data in this file would then be processed by the Jamroom Exporter and Importer modules to fill the content (including files) into Jamroom.


--
Paul Asher - JR Developer and System Import Specialist
alt=
@jrblack1175
4 years ago
26 posts
@Paul, I was able to get 2 files uploaded and can view them, now!

It does seem that in order to enable more files to be uploaded, I'll have to go create a lot more fields, though, as there's no ability to +add+ files after the 2, just replace.

I will also go check out the information on the importer stuff. I have a 500MB DB that I'm exporting. I can backup the db and take a bunch of forums out that I don't care as much about - but I'm not sure about exporting to a CSV file.... What those limitations might be.

If the custom work and the importers will bring over the content with the html coded posts displaying correctly, and the attachments in tact, then it'd be worth it. If not, I'm stuck in the same place I am, now, and may as well just manually bring over select pieces of content...as "just another free service I provide" (for some reason...)

As an example, this is what I'm left with on many of my old forum posts: https://blissfulignorance.com/phpBB3/viewtopic.php?f=76&t=9615&sid=93423dab57ec7005a49f9daf242aa5bc
michael
@michael
4 years ago
7,697 posts
one way it could be done immediately would be to store the attachments in the first comment of the blog post.
(.mp4 screencast is in the .zip file attached.)
zip
text_comments.mp4.zip  •  26.3MB

idea.jpg
idea.jpg  •  907KB

alt=
@jrblack1175
4 years ago
26 posts
That might work. It means people couldn’t comment on it in between.

The use case is: I’m an author; I wrote the first chapter to my story. I upload it to the blog. About 2 weeks later, I have completed a 2nd chapter. I edit and add that to my blog post. Several weeks after that, I add a 3rd chapter.

Hopefully, people have read and interacted with the chapters as I uploaded them...
michael
@michael
4 years ago
7,697 posts
maybe zip the txt files into chapter-1.zip, or label the chapter text files
* april-something-o1.txt
* april-something-o2.txt
* april-something-o3.txt
* april-something-o4.txt
......
Then when the new chanpter comes out, edit the first comment and add some more files
* may-something-o1.txt
* may-something-o2.txt
* may-something-o3.txt
* may-something-o4.txt

The other way to do it is to use the jrFile module and add the files to the FILES tab of the profile so they are there when the blog post is made, then you can use the "Embed Media" (jrEmbed) module to attach the files to the blog post. (bit more work though and I thought the request was one of speed)

Tags