Best method for generating html content to a single web page - php

Good day everyone!
I have a single page, this page has no dynamic content.
I have a set of links. What I need is to have content placed on the page based on the link the user clicks.
Example: I have pictures of animals. When the user click a Zebra, the Zebra info is placed on the page.
So the page does not change, meaning the content on the page changes but not the page it self.
The idea is instead of creating different html pages for each animal profile, the profile is generated to the page from another source.
Is is this possible?
What will be the best way to get this accomplish?
Thanks everyone!
IC

I would probably use jquery to do this. Set your data in hidden divs and just move them into the "display" area when the appropriate image is clicked on.

Related

WP: How to display a jQuery slider instead of a normal post with next/prev button

Here is the problem, I have a WP site that changes the display depending on the presence or not of a parameter in the URL.
If no parameter the whole post shows normally.
If the user has the parameter in the URL the post will be split into many sections (break lines are used as separators) and each time he clicks next the page will load and the URL will change to "/2" for the second element of the post for example. This is what I have for the moment and it works.
With parameter in the URL I want the users to have a slide that only loads the content without the page loading but I can't find a way to do this in WP.
Is it possible with jQuery? For example, load all the content first and show the appropriate section after each click? How would you go about it?
I'm not asking for a code but the logic that you'll use to tackle this issue if you were in my shoes.
Thank you in advance for your suggestions.

Content of frame in wordpress should not be full page rather just the action

In wordpress, i need to create a frame from one page to another but the frame should not display the full page, but the action only, i.e., only the text boxes and labels, submit button
to add a record into the designated table.
I created a frame using the help of the available guidance in stackoverflow from the link below:
How to make a frame in WordPress?
Now, the frame shows the full page, i.e., the admin dashboard, all menus, etc.
In the src="", i have given the link to the page of add action. how to modify this to truncate the extra content?
You could use jQuery to hide the elements:
$(document).ready(function() {
$('iframe').contents().find('#header').hide();
});

How to enusre unique JavaScript Tweet buttons are generated for my dynamic content

I generate content for my page which fills the pages HTML elements from my database using PHP. I have a Tweet button alongside this dynamic content but the tweet button of course is one button and is applied to all of the available content for that page. I need to know if it is possible to somehow set up a unique button for each page.
Here is the Tweet button code taken directly from the Twitter site:
Tweet
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
I was thinking I could maybe use a variable as an id so when the id 5 from row 5 in my database is selected, apply that same id to the JavaScript, I have no idea if Twitter supports this, or this supplied JavaScript can be altered to achieve what I want.
Here is my web page which uses links to set the page content, and you can see the Tweet button is the same for the overall page.
Any insight would be appreciate as I could not see if this has been done before.
Twitter share buttons are used to share a "page url". If you see your code above, it has a data-url in the anchor. This is the page that will be shared when the link is clicked. If the data-url attribute is missing, then it is assumed that you want to share the current page.
Go here: https://twitter.com/about/resources/buttons#tweet and get the code. Make sure you have "Use the page URL" for the share URL. This way, you insert the same code on all pages, yet they really share the page you're currently on.

Show different content in sidebar based on user behaviour

I'm planning a site and I was thinking would it be possible to show alternate content in the sidebar based on the behaviour of the visitor? Say the user has clicked on link X on page A and I want the alternate content in the sidebar to be shown on page B, if they clicked on the link. Also, if the visitor fills out a form, would it be possible to associate the tracking cookie information with the submitted form to see what pages the visitor viewed? Would this be easier to implement in a particular cms?
I would appreciate it if someone could at least point me into the right direction. Thanks in advance!
Yes anything is possible & no need for cookies (unless you want to keep a persistent track of the user)
Have a relationship column next to the content in your db, when creating the content assign this value much like a category or tag ect.
Then when user clicks on link A as the page loads store its relationship in the session, then when link B is clicked load content related to the previous set session value.

Jquery Pagination with different URL's

I am looking to build a single page with 1000+ pages, dynamically generated from a database. One row in the db = 1 page.
I'd like the navigation to load a different, initially hidden with jQuery, and I believe I'll be ok doing so, however I'm also hoping for each individual post/div to be accessible with a direct URL, for example site.com/page.php?page=1
Is there a way to make the url change onclick, along with the div? This way, if I had a facebook share button, it would actually share a specific post, and not just the same static page.
Thanks!
You can use the jQuery plugin BBQ http://benalman.com/projects/jquery-bbq-plugin/

Categories