Integrating a Back button - html

I have this theme http://themes.two2twelve.com/site/fluidapp/light/ installed on my website running wordpress. I converted the template to a wordpress theme by following the steps here: http://thethemefoundry.com/blog/html-wordpress/ and its all working fine.
However, I have now been given the crazy task to integrate a "Back button" function in it.
What they want is to have some sort of Back button functionality (or the browser one) so when they open Team and they press Back - they go back to Home. The template is basically one-paged, you can see so in the source code.
One way I can see this happening is if I make every page a different .php file, upload them to my theme folder and then just hyperlink them. like www.yoursite.com/team.php
Another possible way (I think) would be to create a page.php template file and then post the pages using wordpress. Question: How do I tell wordpress to use page.php as the page template file?
Can you think of another way to integrate this functionality? Thanks a lot in advance.

If it always is going to return the user to the startpage you could just use the home_url(); function.
Back
If you got more advance structure and you want the button to just redirect the user back one page, you should use javascript.
Back
page.php is the default template for wordpress pages. So if no other is selected in admin, page.php will be used.

If you're using javascript to load the new content, you could use javascript pushState()and popState() to log the stuff to new url's, and it gets added to the browser history. Here's an example.

Related

Saving static HTML page generated with ReactJS

Background:
I need to allow users to create web pages for various products, with each page having a standard overall appearance. So basically, I will have a template, and based on the input data I need the HTML page to be generated for each product. The input data will be submitted via a web form, following which the data should be merged with the template to produce the output.
I initially considered using a pure templating approach such as Nunjucks, but moved to ReactJS as I have prior experience with the latter.
Problem:
Once I display the output page (by adding the user input to the template file with placeholders), I am getting the desired output page displayed in the browser. But how can I now obtain the HTML code for this specific page?
When I tried to view the source code of the page, I see the contents of 'public/index.html' stating:
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
Expectedly, the same happens when I try to save (Save As...) the html page via the browser. I understand why the above happens.
But I cannot find a solution to my requirement. Can anyone tell me how I can download/save the static source code for the output page displayed on the browser.
I have read possible solutions such as installing 'React/Redux Development Extension' etc... but these would not work as a solution for external users (who cannot be expected to install these extensions to use my tool). I need a way to do this on production environment.
p.s. Having read the "background" info of my task, do let me know if you can think of any better ways of approaching this.
Edit note:
My app is currently actually just a single page, that accepts user data via a form and displays the output (in a full screen dialog). I don't wish to have these output pages 'published' on the website, and these are simply to be saved/downloaded for internal use. So simply being able to get the "source code" for the dislayed view/page on the browser and saving this to a file would solve my problem. But I am not sure if there is a way to do this?
Its recommended that you use a well-known site generator such as Gatsby or Next for your static sites since "npx create-react-app my-app" is for single page apps.
(ref: https://reactjs.org/docs/create-a-new-react-app.html#recommended-toolchains)
If I'm understanding correctly, you need to generate a new page link for each user. Each of your users will have their own link (http/https) to share with their users.
For example, a scheduling tool will need each user to create their own "booking page", which is a generated link (could be on your domain --> www.yourdomain.com/bookinguser1).
You'll need user profiles to store each user's custom page, a database, and such. If you're not comfortable, I'll use something like an e-commerce tool that will do it for you.
You can turn on the debugger (f12) and go to "Elements"
Then right-click on the HTML tag and press edit as HTML
And then copy everything (ctrl + a)

How can I access/edit the HTML file on Shopify?

I know this is probably a very basic/obvious thing, but I'm new to Shopify and trying to assist a client while a colleague is on vacation. I know what I need to change and how to change it, but not how to access it. When I go to Online Store and click Edit Code, I see all the Liquid, JSON, and even CSS files, but I can't find the HTML file I need to edit, nor can I find any of the HTML I need to edit within the theme.liquid file. The resources I'm finding are all either outdated (there is no "Edit HTML/CSS" option on the dropdown anymore) or unhelpful (like this). I can see the HTML in the console and upon clicking View Page Source, but I don't know how to get to it through Shopify. I feel like I'm losing my mind because this HAS to be very simple and obvious. If someone could please tell me how to access and edit the HTML file on Shopify I would be VERY grateful!
The html files are the liquid files.
There are no actual HTML files since this is a Shopify theme.
Depending on your theme, your files are located in:
theme.liquid - here are the header and footer
templates/*.liquid - all liquid files here are the main templates for the different pages
sections/*.liquid - the files here are usually used on the homepage and other pages as well
snippets/*.liquid - these are the reusable code snippets
So depending on your changes you will need to go through these files and update them for the specific changes.
Please have in mind that these files may be used on multiply pages and if you change one of them there is a possibility that this will affect other pages as well.

mailchimp signup form leads to 404

I have a mailchip signup form in the footer of my site. I've noticed recently that after trying to signup, the user is greeted with a 404:page not found error reading:
MailChimp It seems the page you were looking for has disappeared We’ve
recorded this vanishing act and our team of chimp magicians will find
the missing link.
The form worked perfectly on my old site, I'm not quite sure why it's suddenly stopped- I didn't change anything but the styling.
When you create your MailChimp subscribe form, you have the option to specify your own Thank You page that users are sent to after they subscribe:
http://kb.mailchimp.com/article/can-i-design-and-host-my-own-thank-you-pages-instead-of-using-mailchimps/
Are you sure that MailChimp isn't trying to redirect your users back to a Thank You page of your own... that no longer exists on your end?
Regardless, I'd recommend going through the steps on that page to create a new subscribe form from scratch, specify the options including the Thank You page that you want to use, and place the new embed code in the footer of your website. That should fix whatever is currently broken.
your question is broad,It may have multiple reasons:
1: Compare your old code and new code and see difference if any malicious code is written (includes other pages or script that leads to errors)
2: Check if the Signup page (abc.html etc) file is present on the server and not deleted/Renamed during deployment. Also check nested pages that are included as headers/ footers
3: Some times files are placed in the wrong directory. Make sure particular file is placed at the required location.
please specify what type of page is it and called from which source (JSP/simple html etc).

Default Pages with Theme Install

I'm building a theme to be my deafult template to all my wp installs, I've managed to sucessfully create a theme options page and I can integrate them a page theme, but for this to work it is required that I create a new page, for instance, "Privacy Policy", set the page theme to my costum page theme that calls theme options, publish the page, modify the theme options in admin area. This works, but this is nto what I'm lookig for,
What I want is a pipeline that goes like, ->install theme->configure theme options-> done
I want to skip the process of creatign a new page and applying the page theme to it, I would like do this "hardcoded", like, a link in the footer to /privacypolicy.php", problem is that it does not work this way, I'm guessing this would be something related to .htaccess, like adding the permanent redirect to the full themplate directory / targetpage.php / and redirect it to something like "blogurl/privacypolicy", is it? the probleme is I know squat about configuring a .htaccess redirect or whateverm what should I do?
Thanks
Just an idea...what if you setup a clean WordPress install using the theme you developed. Add a page and put in the content that you want (Private Policy) and then extract the page entry from the table that WordPress stores it in and convert it into a sql statement which you then execute when your theme is activated. Make sure though that the page does not exist yet. Hope this helps.

Getting plain HTML/CSS versions of Wordpress themes, no PHP?

where can I find elegant looking Wordpress (or not Wordpress, but similar style) themes in plain HTML/CSS format, without all the php?
thanks.
View the page source of the theme preview page in your browser. Save the code.
Easy for one page. Difficult for many pages.
You need to see in browser each page you want to get the HTML/CSS.
Firefox Menu > View > View Source
IE Menu > View > Source
A good way not only to save but to study the design and HTML/CSS structure,
use FireBug, Firefox addon. I am very sure it save lots of time and you will love it.
I'm not sure what you mean in your question.
If you mean, "Are there themes for Wordpress that don't require php?" then the answer is no. However, you don't actually need to know php in order to use these themes. You can just load them and then alter only the CSS.
If you mean "How can I adapt a Wordpress theme for a non-Wordpress site?" then you'll have to do this yourself, manually. First make sure you are using Firefox and install Firebug. Go to a site that has the theme that you want and then open up Firebug.
Under the HTML tab you'll be able to see the static HTML of the page, after it has been processed by the backend PHP. Just click "Edit" and then copy and paste everything in there into a new file. Then click the "CSS" tab and go through each style sheet, again clicking on Edit in order to copy and paste everything into new files, 1 for each sheet. Then stick all of the files into a folder and edit the header of the html file to make sure the external stylesheet links are pointing to the stylesheets you have created. Open it up in a browser and it should look just as you want it to.