Embed a single wiki page in a javascript page (dynamic creation) - php

Can we have a wiki page -e.g. in a tab- (to collaboratively write and edit a text) inside a javascript page by a PHP server?
What I want is the following: consider you have a website (javascript, php) showing some information, and you want your page to consist of two tabs: one for the information display and one as a single wiki page to collaboratively write something about the information tab. As an alternative to the tab, we may use a link but I don't want the link to direct user to an external page or to another system (like a standalone complete wiki).
I haven't used wiki (as a programmer), if the answer to this question is positive, then I will start using it! So, please consider me as a total beginner. If you know something other than wiki which can support collaborative editing on a single page please let me know, there should be lighter techniques.
EDIT:
I want the page to be dynamically created, so having only one page is not useful, I have n information tabs which are created according to some data and I need n corresponding wiki pages (so, I can't create these pages manually and add them to my system).
Thanks

We are using a similar solution by simply using a IFRAME pointing to a external wiki URL. The URL depends on the item the user is currently working on.
Most Wiki systems allow you to open any inexistent URL/Wiki page and create the page with one click.
In our case we are using MoinMoin wiki, but I guess you could use almost every Wiki system out there.

Related

Dynamically Creating pages based on user's input

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.

How to auto fill Text box in php (Similar to Facebook)

What I am trying to do is to make something similar to what I see all the time on almost any website. The button that says Share to facebook. The goal for me is to let my guests share the item they are viewing in my store (Ran on prestashop) on their blog I run (Running on Oxwall).
The goal is for the button to not only link to a blog post submission webpage but to already have the subject line filled out with the item they are sharing's name and the blog post to display the information about the item. I would like to try and do all this using PHP. I am not sure how to go about doing it but I am sure that I could pass the value. Please note that I can mod BOTH the blog site and the shop as I run both and want to connect them.
As an extra bonus I am also running a forum using phpbb3 if I could do the same thing but onto that as well I would greatly thank you. I am trying to interlink everything into one big network. I know its not an easy task but I am sure there is an easy way to pass data onto the other site so that this can be done.
Facebook a 2 tools to get items informations in the page, it parses the page looking for the most common tags and it uses OpenGraph.
You can also provide product informations in the head of your page (between head tags), then blog side, you retrieve only the contents and parse it as XML.
I advise you to cache this data to avoid useless connections between websites and awful overloads while parsing.
You can use your own specifications, Open Graph or another standard, but i advise to use a standard.

Dynamic links should be included in sitemap?

I have a website live cricket scores , in which dynamically i am controlling the news section.
I have my own custom build CMS system with PHP, where admin will add the news to the web portal.
If i generate the Sitemap, all dynamically created pages wont be added to the sitemap,
is this a good practice or do we need to add the dynamically created links in sitemap?
if yes, can you please share how we can add dynamic links?
One more observation, I have made, whatever the news which is added getting cached within 4 Hrs in google.
Please share your thoughts, thanks in advance
If the pages are important, then you should add them to the site map so they can be indexed for future reference. However, if the pages are going to disappear after the match, then I wouldn't put them on the site map as they may get indexed then disappear, which may have a negative impact on your search engine rankings.
You can add these dynamic pages to a site map in a couple of ways:
Whenever a new dynamic page is created, re-create your site map. Do this by looking through the database for the pages which will be valid and writing them out into an XML site map file.
When a new page is created, read the current XML site map, and insert a new entry into the relevant place.
I would say the easiest option is option 1 as you can quickly and easily build a site map without having to read what you already have. That option also means that when you remove a one of the dynamic pages, it will be removed from the site map when it is re-built without the need to read through what you have, find the entry and remove it.
Google code has a number of different options for you, some of which you can download and run, others look like they need implementing within your own code.
Yes, if these pages content needs to be referenced by search engines, of course they have to be in sitemap.
I worked on a lot of ebusiness website and of course, almost 99% of pages where dynamically generated, almost 1000 product pages versus the 3 sales conditions & legal static pages.
So the sitemap itself was dynamic and regenerated every 15 minutes (to avoid dumping the whole product base each and running thousands of queries each tim the sitemap is called).
You can use a sort of separate script to do this : I would do one static part template if you have static page, and one other embedding the dynamically generated urls.
It would be easier if you CMS already embed url management (or routing) system.

PHP/JS: How to implement dynamic breadcrumbs? (multi-window/tab compatible)

I'm working on a site where we need "dynamic" breadcrumb generation.
Pages within this application are not specific children of the other, so when the user is browsing one of them, I can't simply retrace steps back up.
I could have the following breadcrumbs-like lists: (updated)
* inbox > message > user profile
* search results > user profile
* search results > user profile > new message
( FYI; there will be a few dedicated parent pages that will reset the whole stack. Also there will be a check that prevents recursion. )
So... To accomplish this, I have to remember where the user has been, and in what order. I reckon the most elegant and reliable way to do is, is write a mechanism that remembers the user's history in the session.
If I do that though, the whole thing will break when a user opens a new browser window or tab.
To fix that, I could store this data in the querystring. Though different browsers/proxies have different limits of data that can be transferred that way. So, one day, this will probably break as well.
Does anyone have an idea on how to implement this?
Or;
Does anyone know how to reliably identify different browsers windows?
(I'd rather not rely on javascript for this, unless it's my only workable option. I use dojo toolkit for the frontend)
thanks in advance!
On HTML5 compatible browsers I would save these on the local storage.
You can detect a new tab open like this:
on page load set a cookie by javascript
use the onbeforeunload event to clear the cookie
When the visitor will open your site, it will set a cookie eg session=1, if they click on a new link on your site, when they leave the site the cookie will be eg session=0 but as soon as they arrive again on your site it will be session=1.
When the visitor will open a new tab, it will encounter a session=1 so probably will do that session=2. You got the point?
window.name survives a new document load. So you can write a history string to window.name and then read it back from the next page, or use a generated name as a key for storing window-specific cookies/sessions.
I don't think this is a good idea though. “Breadcrumbs” are traditionally a hierarchical navigation device, not a history list. The browser already provides a perfectly good history list on the back/forward buttons that it is not useful to reproduce on the page; presenting an on-page history list, especially in a format that is normally a hierarchical place marker, is more likely to confuse users than to be of any help.
I asked a similar question a few months ago. The top answer - which I will am planning to go with - suggested building a path, and parsing that using a combination of mod_rewrite and PHP:
www.mysite.com/inbox/message/user_profile/12345/new_message
Up to a certain point (the request URL should never grow larger than 1024 bytes), that can be quite a good solution. An additional advantage is that the breadcrumb path can even survive sessions, and works in links forwarded to others (if that is desirable in your scenario).
Another thing, looking at your examples, I can't really see the need to reset the history when the user opens a new page, or to take different browser windows into consideration at all. There is a logical hierarchy (not a history) and why should the system start changing then hierarchy just because I choose to open the new message editor in a new tab?

How to redirect a Google search result to a dynamic Web page?

I'm trying to enter a list of items into Google Base via an XML feed so that, when a user searches for one of these items and then clicks the search result link in Google Base (or plain Google), the user is directed to a dynamic Web page on my Web site. I'm assuming that the only way to specify a specific link (either static or dynamic) is through the attribute in the XML feed. Is that correct? So, for example, if my attribute is:
http://www.example.com/product1-info.html
the user will be directed to the product1-info.html page.
But if, instead of a static product page, I want to have the user redirected to a dynamic page that generates search results from my local database (on my Web site) for all products containing the keyword "product1", would I be able to do something like this?:
http://www.example.com/products.php?productID=product1
Finally, and most importantly, is there any way to specify this landing page (or any specific landing page) from a "regular" Google search? Or is it only possible via Google Base and the attribute? In other words, if I put a bunch of stuff into Google Base, if any of it shows up in a regular Google search, is there a way for me to control what parameters get passed to the landing page (and thus, what search is performed on the landing page), or is that out of my control? I hope I explained this correctly. Thanks in advance for any help.
first question: Yes, urls containing a query_string part are allowed.
http://base.google.com/support/bin/answer.py?hl=en&answer=78170 says:XML example:
<link>http://www.example.com/asp/sp.asp?cat=12&id=1030</link>
--
Let me rephrase the second question to see if I understand it correctly (might be completely on the wrong track): E.g. products.php?productID=product1 performs a db-search for the product "FooEx" and products.php?productID=product2 for "BarPlus". Now you want google to show the link .../products.php?productID=product1 but not ....?productId=product2 if someone searched for "FooEx" and google decided that your site is relevant? Then it's the same "problem" we all face with search engines: communicate what each url is relevant for. I.e. e.g. have the appropriate (and only the appropriate) keywords appear in the title/h1 element of the page, avoid linking to the same contents with different urls (e.g. product.php?x=1&productId=1 <-> product.php?productId=1&x1, different urls requesting most probably the exact same contents), submit a sitemap, and so on and on....
edit:
and you can avoid the query-string part all together by using something like mod_rewrite (e.g. the front controller for the zend framework makes use of it) or by parsing the contents of $_SERVER["PATH_INFO"] (this requires the webserver to provide that information), e.g. http://localhoast/test.php/foo/bar -> $_SERVER['PATH_INFO']=='/foo/bar'
Also take a look at the link to this thread: How to redirect a Google search result to a dynamic Web page?, it contains the title of the thread, but SO is perfectly happy with How to redirect a Google search result to a dynamic Web page?, too. The title is "only" additional data for search engines and (even more) the user.
You can do the same:
http://www.example.com/products.php/product1/FooEx <-> http://www.example.com/products.php/product2/BarPlus

Categories