I am working on building a application where user gets a canvas(not html canvas, a work area) with many features.
For Eg:
User can add/edit/delete - text/image/shapes
User can move(drag)/rotate/resize elements.
Save their work.
And similar many features.
NOTE: Till now I have been storing the user template data in database as plain html. But I have a feeling that it is wrong what I am doing.
I want know what is the best approach to save & process their templates they create.
Related
I want the user's profile to show everything (logged in navbar, textbox they use to post their content on and all of their content) and then show their profile with a logged out navbar, selected content the user wants to show and no textbox to post content.
I am breaking up the html files (e.g. header, footer and main content) into separate php files. Is that a good idea if I want to implement the above said ?
I'm still developing on localhost but here's the current file structure which is a bit messy. I'm also trying to implement MVC but due to my lack of knowledge so far, it hasn't been done.
However you seem fit, but nice practice could be dividing up backend / frontend. Or have a public and a private directory as top layer, then go from there.
And yes, breaking up your files in header.php, *content.php and footer.php is smart for what you want. By doing this, you allow yourself to edit the main parts of you page independently, without having to update many html or php files. Just one file will do for every page.
Also google stuff like "common practice" for php structures.
Account for REST in your workflow How to create a RESTfull api
This Stackoverflow on html/php inlining is also usefull maybe.
I have an article website. So far, all my articles have been created by me working with the code. Copying and pasting the code and editing the P tags, H1 tags, etc. This turns out to be a hassle and increases the chance of you making an error. Especially when the article has multiple pages.
Future-wise, I want users to create articles. So this is what I want: User clicks on button that says 'create an article' and then the user gets redirected to the article builder page where they can make an article for themselves. The user will create a name for their article, this name will create a folder on my server...for example: www.example.com/articles/name-of-article. Then the user can write the article. The user will abide by classes I have created for tags, but those tags will not be seen by the user. The user only sees that their content is getting adjusted well based on my CSS template. Also, if the user wants to add another page to the article, they can put in already built buttons...they just have to change the links to those buttons. The user should also have the ability to bold, underline, and italicize text.
Note: Users are working with a pre-built template, not a blank page. The template article includes a recommended panel, showing other articles. The user does not have permission to edit this panel.
I've heard about WYSIWYG HTML editors, but I just want to know if this is the right thing for what I want. Is there something else that can accomplish my task better? If WYSIWYG is the best answer, can it do everything I've asked for?
P.S: My article pages are PHP pages, with HTML and Javascript included.
You don't need to write html codes of articels in php. I would suggest you to use a content management system (CMS) like Wordpress.
What you want is a CMS. Wordpress is the best approach for your needs, but if you can't use it, you can search for other CMS systems/frameworks.
If you want to make/use your own, just remember to do a Template framework.
And appart of your main question about WYSIWYG, yes, you can do all you asked if it can be done with PHP.
I'm building a webapp which main purpose is displaying widgets on a display. These widgets have an variable size, so not every widget is even high or wide (But they are using standards like for example a grid system). Now I'm looking for the best way to save which widgets are used, and where they are placed. For example by using something like Gridstack the user can drag and place the widgets in an admin panel, but how should I save this? And how can I recall this and put in a empty Bootstrap page for example. Working with the Bootstrap Grid system would be great aswell.
I did some research on Google and here but didn't find any plugins or ways to do this.
I'm using 'Gridster' at the moment which this Gridstack is built off of/inspired by, so it probably won't be able to save for you.
You'll need to do that, either by sending it back via AJAX or storing in local storage. As it looks similar, you should be able to find a 'serialization' function which should wrap it up ready for you to send to your PHP via AJAX.
You may need to scan through the widgets and wrap them up in your own JSON string, such as the row/column/sizex/sizey which is all the grid system really needs to "add" a widget when its first loaded up, so as long as you can feed that back in you should be good to go.
As a project I would like to create a website that allows a user to login (create a login/password if doesn't exist) and enter some data for the day (say miles run, calories burned, situps done, etc). The website would record this data for the user for that day and build a running log of various activities. The user would be able to go back and edit entries. The user could then view the history of their various activities.
I have written some perl code to handle the various analysis that I intend to do on the user-entered data. I also can easily create a perl script to save a flat file with the user generated data appended with the data and allow editing.
But I have no clue how to get this into a web experience and unfortunately I don't even know where to start!
Any idea how I should go about doing this? It doesn't need to be a super fancy website, just functional. Where should I start?
Thank you
See Ovid's CGI Course. CGI.pm is a simple Perl tool to create web pages. For more advanced tool look at Mojolicious framework. I use CGI::Application framework but it is old and for me it is already too simple, Catalyst and Mojolicious are more advanced.
I would use WordPress or Drupal as the basic framework. In Drupal7 you'd create a new content type, in Wordpress you'd create a new "Post Type" (new as of WP 3.0) for users to enter data. You'd then write code to fetch & process that data.
But you could off course just use WordPress with the Runners Log plugin (and Drupal probably has a similar plugins), if you wouldn't want to do the coding ;-)
I am using modX cms, and would like to have administrators be able to create some form fields in a larger form (basically a label, and form elements of various kind) which is then made accessible to users as a PDF document which is to be downloaded, filled out, saved and sent to appropriate recipients via email as pdf.
The main difference to other similar questions is that i do not want to actually process the CONTENTS of a form and output a PDF, i want to generate a PDF which contains a FORM based on data [field names/types] found in a CMS.
The main purpose of the application is that forms have to be easily administrable, hence the integration with a CMS. Nothing speaks against using and writing custom code and/or libraries.
I would also consider an option of having a PDF which is able to send its results out by itself, but from what i've understood i'd have to purchase the adobe formbuilder package and that would raise the price too much.
Any hints on what libraries/approaches i could use?
Thanks
TCPDF is recommended
see also the link in the bottom on the wikipedia entry . There are a bunch of existing examples and plugins you could copy&paste from.
There's PDFlib, from which you can generate a new PDF from the ground up, or modify an existing one (including add forms). It is, however, fairly pricey, so if you can't afford Adobe's formbuilder, this is probably too expensive as well.