The new forums will be named Coin Return (based on the most recent vote)! You can check on the status and timeline of the transition to the new forums here.
The Guiding Principles and New Rules document is now in effect.

[Web Programming] Dynamic DIV contents

cmsamocmsamo Registered User regular
I have built a simple video gallery for my site - using divs and HTML5 stuff - and it works really well for showing videos that I drop onto my web server in the /video/ directory. Basically, I define the video that will play, it's height, width, and a caption, by hard coding the HTML, and reloading the page. In the code snippet below are 3 example videos:
<div class="video_gallery_container">
<p><a class="videoLink" videowidth="1280" videoheight="720" videofile="myfirstvideo"  videocaption="video1caption" ></a>
<a class="videoLink" videowidth="1280" videoheight="720" videofile="mysecondvideo" videocaption="second video caption" ></a>
<a class="videoLink" videowidth="400" videoheight="250" videofile="video3" videocaption="woohoo"></a>
</p>
<div class="clear_both"></div>
</div>

It all works really well. Apart from it's not dynamic. What I want to prevent is the situation where the user(s) of my site change the videos, and I have to manually come in and update the links.

I can't think of a good clean way that's easy to implement, whereby they drop the new files into the directory, then access a management page, hit a button to regenerate the links, and insert the newly created HTML into the main page.

Any of you web-heads got any ideas on how this could be achieved? I should add that this is for a closed intranet (not public internet facing) and my server is an IIS server.

steam_sig.png

Posts

  • bowenbowen Sup? Registered User regular
    You're likely going to need php/asp to deal with dynamic things like this. Javascript could probably do it as well.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • cmsamocmsamo Registered User regular
    Yep, right now I am thinking about creating ASP on the server end to handle file uploads, and append a text file in the website directory whenever a user uploads a video (containing comma separated data values for my HTML) and then having a script on the public page that reads the contents of the text file and creates the HTML for me dynamically - thereby updating my gallery with the latest videos?

    steam_sig.png
  • bowenbowen Sup? Registered User regular
    You could just get all the contents of a directory and spit it out that way, too.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • DisrupterDisrupter Registered User regular
    Im sure there is likely some sort of content management system or video library application or something out there that you could simply style to meet your needs. Im sure you could probably do something with Wordpress (php cms).

    616610-1.png
  • Spectral SwallowSpectral Swallow Registered User regular
    You may be able to accomplish something like that with PHP and a SQL table. Depending on the number of users, etc.

  • FeralFeral MEMETICHARIZARD interior crocodile alligator ⇔ ǝɹʇɐǝɥʇ ǝᴉʌoɯ ʇǝloɹʌǝɥɔ ɐ ǝʌᴉɹp ᴉRegistered User regular
    edited August 2013
    You basically have two options:

    1) Code something from scratch that will do this using a server-side scripting technology such as ASP, .NET, PHP, or Ruby.
    2) Adopt a CMS (content management system) that has this functionality already, and learn just enough PHP or Ruby to tweak that CMS.

    Most of the time, #2 is your better option.

    #1 is fine if:

    - You only want your site to perform this one task.
    - You will never want to expand your site to perform more than this one task.
    - If you ever leave this job, you don't expect the person coming after you to ever want to expand this site to perform more than this one task.
    - The site is always going to be for internal use only, and never ever exposed to the Internet.

    If you choose to do #2, the big two CMS options are Wordpress and Drupal. Both are written in PHP. Some other reasonable alternatives are Concrete5, Refinery, and Radiant.

    If you have a license for it (which you might, if you already have Microsoft server software), then you can also give Sharepoint a try. (Personally, I despise Sharepoint, but people out there seem to love it... for some reason...)

    Of these, Wordpress is the simplest to get started and the most popular. The workflow to get started would look something like this:

    Install a SQL database (MySQL or Microsoft SQL Server Express).
    Install PHP.
    Install Wordpress.
    Find a plugin for your specific task. One of the more popular relevant plugins is WP Video Posts.
    Find a custom theme that you like. Tweak that theme a little to your taste.

    You can find more detailed instructions for each step via the Googles.

    Feral on
    every person who doesn't like an acquired taste always seems to think everyone who likes it is faking it. it should be an official fallacy.

    the "no true scotch man" fallacy.
  • cmsamocmsamo Registered User regular
    I actually have all the content managed in a separate share point site right now, so a really quick and dirty way to solve the problem is to make static links in my page, which match the share point location of the videos. I tested it and it works, but it's not elegant. On the plus side the users are already used to uploading precisely named files to share point list, so it may work

    steam_sig.png
  • cmsamocmsamo Registered User regular
    But yeah I actually like the idea of just installing Wordpress on a fresh web server and doing it with plugins

    steam_sig.png
Sign In or Register to comment.