WordPress.org

Ready to get started?Download WordPress

Forums

Include a webpage into a page? (31 posts)

  1. simenfs
    Member
    Posted 8 years ago #

    Hiya!

    I have my WordPress all set up allright, but I would also like to add a shop. So I have got myself a shop from spreadshirt.net. My question is how do I implement the shop into a page? The Shop is alittle wide, so I need to remove the sidebar aswell I think.

    Spreadshop.net has this html code that you could use to implement the shop, but I don't want it to be an iFrame, I just want it showing as a normal page in WordPress.

    Heres the iFrame link:
    <iframe height="540" width="620" src="http://www.spreadshirt.net/shop.php?sid=110931" name="Spreadshop" id="Spreadshop" frameborder="0"></iframe>

    Thanks for any help! :)

    PS: I've allready tried the Spreadshirt plugin from Tassomoni (or something), but it only gives me these errors:
    Warning: Cannot modify header information - headers already sent by (output started at /home/www/vsffc.com/wp-content/plugins/spreadshop.php:212) in /home/www/vsffc.com/wp-admin/admin.php on line 10

    Warning: Cannot modify header information - headers already sent by (output started at /home/www/vsffc.com/wp-content/plugins/spreadshop.php:212) in /home/www/vsffc.com/wp-admin/admin.php on line 11

    Warning: Cannot modify header information - headers already sent by (output started at /home/www/vsffc.com/wp-content/plugins/spreadshop.php:212) in /home/www/vsffc.com/wp-admin/admin.php on line 12

    Warning: Cannot modify header information - headers already sent by (output started at /home/www/vsffc.com/wp-content/plugins/spreadshop.php:212) in /home/www/vsffc.com/wp-admin/admin.php on line 13

    Thanks for all help

  2. moshu
    Member
    Posted 8 years ago #

    For teh second issue (the error) see this:
    http://codex.wordpress.org/FAQ_Troubleshooting#How_do_I_solve_the_Headers_already_sent_warning_problem.3F

    As for the iframe. If you don't want it (which I fully understand), try to make a Page template and include the code in that file. After that create a a new Page using that template and it should work.

  3. simenfs
    Member
    Posted 8 years ago #

    I think I will go for removing the iframe, but what I don't know how to do is how the code should be in the template. I'm very unexperienced with php and can only change and edit whats allready there.

    Could you just pase in the code and where I should put the url/address to the shop?

    Thanks alot -:)

  4. meatcake
    Member
    Posted 8 years ago #

    Well I hope you're still following up on this post, because I can help you.
    I have a css file, a 2-line php script and a block of javascript code you can have.

    The rest is so easy I would just email you the zip right now.
    go to http://www.in2mind.com/blog/ i'll post it up in my blog. (by evening dec 10th)

  5. lxg
    Member
    Posted 8 years ago #

    You can't put PHP code into a WP page, because the php tags would be converted into HTML special characters. This is also a security feature.

    There is, however, a Plugin named run PHP (and similar ones, too), but I don't think they will allow to run such complex apps like a webshop.

    I suggest you grab the HTML output of your WP install (after having finished customisation ;-). Then, based on this, you build a template for your webshop.

  6. simenfs
    Member
    Posted 8 years ago #

    meatcake: Oki, I'll check it out later today :)

    mastermind: I don't want to make a shop, because I allready have one; vsffc.spreadshirt.net

    But what I want is to just to add that ship into a WP page. I have Dreamwaver so I can make a new page template, so I dont need to use php tags inside the Write Page in the admin. But I don't know the correct code to use to have the template display the shop...

    If you get me.

    Thanks for reply so far :)

    PS: I solved the plugin error, and it's working, but I would still like to get the other method to work too :)

    Thanks

  7. simenfs
    Member
    Posted 8 years ago #

    And one more small thing about the plugin. I got it working, and made it active. You see the shop page here with the plugin: Plugin shop

    But as you can see the image goes over the div. How do I correct that?

    Heres the css and code for it:
    CSS:
    .spreadarticle {
    clear: left;
    border-bottom: 1px solid #666;
    margin-bottom: 2em;
    }
    .spreadarticle img {
    float: left;
    }
    .spreadarticle h3, .spreadarticle p {
    margin-left: 150px;
    }

    Display Code:
    <div class="spreadarticle">
    &article_id=<?=$article["id"];?>" title="<?=$article["name"];?>" target="_blank" rel="no-follow"><img src="http://www.spreadshirt.net/<?=$article["picurl"];?>" alt="<?=$article["name"];?>" />
    <h3><?=$article["name"];?></h3>
    <?=$article["description"];?>
    KR:. <?=$article["price"];?>
    </div>

    Thanks for any tips about this, and my earlier post about the template thing :)

    Edit: And why does it show � instead of the norwegian letters; æ, ø, å? The letters show as normal on the other parts of the website

  8. lxg
    Member
    Posted 8 years ago #

    Sorry, if I don't get you correctly. But as far as I see, we have several premises:
    1. The shop has to perform different kinds of action. So there have to be either more than one pages or one page handling the actions by the query string.
    2. the shop itself is not hosted on the same site as your blog, so any link to a shop item goes to another page anyway.

    Now, if I understand you correctly, you want to include the very HTML of the shop into your blog. This is -- theoretically -- possible, but I wouldn't do that. To get it working, you would need something like

    <?php
    echo file_get_contents('http://the-shop-website.com');

    (just a starter)
    For this to work you'd need to put allow_url_fopen = On in your server's php.ini and you'd need a plugin which runs native php inside a WP page (as I posted above).

    However, I don't need to say that running code from an external webpage is highly dangerous; even if you trust that page you are risking man-in-the-middle attacks and similar threats.

    Back on template building ;-) I meant you could just take the HTML output of the page and replace anything inside the <div id="content"> by your shop stuff. Then you put your WP CSS there, ready. The question is just: in how far are you able to customize the spreadshirt template.

  9. lxg
    Member
    Posted 8 years ago #

    what is this?! second time I'm pushing "submit" once and end up with double posting?!

  10. moshu
    Member
    Posted 8 years ago #

    And why does it show � instead of the norwegian letters; æ, ø, å? The letters show as normal on the other parts of the website

    I'd suspect you edited those lines in a text editor that didn't have utf-8 support.

  11. simenfs
    Member
    Posted 8 years ago #

    Thanks for reply :)

    Since the first option was dangerous concerning attacks, I will drop that one :) I don't want angry buyers at my door with a bat... Would've been highly unpleasent.

    Heh, I think I partly understand the template thing now. Will try it out asap. As far as the customization of the spreadshirt shop, it is atleast there, and I think the options goes as far as to colours and fonts, and background colour. I can also change the number of products in a row vertically, and that was it I think.

    But if I make the template as you said, won't all the stuff there go under the WP css? If so I could just add and edit in the Wp css to get the desired layout I think (hope).

    Thanks for fast reply

  12. simenfs
    Member
    Posted 8 years ago #

    Connection is slow, so got a double post :/

  13. lxg
    Member
    Posted 8 years ago #

    As far as the customization of the spreadshirt shop, it is atleast there, and I think the options goes as far as to colours and fonts, and background colour. I can also change the number of products in a row vertically, and that was it I think.

    Then I'm afraid the template idea is not for you. :-( I thought you'd have a bit more influence on the shop's HTML...

    But if I make the template as you said, won't all the stuff there go under the WP css? If so I could just add and edit in the Wp css to get the desired layout I think (hope).

    That of course you could do. You could adapt your WordPress to look like the spreadshirt shop. ;-P But I don't think this is the real thing.

    As far as I see, the iframe would be the nicest solution under your circumstances.

    Apart from that, I've been playing around with Joomla! lately. This is an easy to set up OpenSource CMS where you can have both a blog and a shop. Maybe this is more suitable for you?

    *duckandcover*

  14. simenfs
    Member
    Posted 8 years ago #

    *Darn, missed*

    Hehe, ok, I guess I jsut have to use the plugin in then, it works Ok I guess :) Except my little problem with the image going over the div.

    Joomla! is some where along the lines of Mambo if i'm not mistaken, and Mamba didn't really suit me. I really like WP so I think I'll stick with it :P

    And if you're still with me here, do you think you could take a fast look at my problem with the plugin? (Some post earlier)

    Thanks anyway mate, you've helped me alot :) :) :)
    simenfs

  15. lxg
    Member
    Posted 8 years ago #

    I just fed the W3 validator with your shop page. You still have some non-utf8 characters inside your page, which is why I overwrote it with ISO-8859-1. Then it seems you have nested a <style> section inside the document <body> (and there are other errors, too). This is not valid and therefore I suppose this to be the display error.

    Also, you might want to validate your CSS.

  16. simenfs
    Member
    Posted 8 years ago #

    Humm. I'll take a look at it now.

  17. simenfs
    Member
    Posted 8 years ago #

    Ok, looked at it now, and I'm totally blank. I have no idea what caused the errors. And would be seriously happy if you could help me here. If it would make it easier, heres the file: spreadshop.phps

    Thanks alot :)

  18. lxg
    Member
    Posted 8 years ago #

    Sorry for not answering so long... I'm from Germany (GMT +2) and, err... hat a long Saturday night yesterday. ;-)

    Well I'll take a look at it now. At first glance, I saw it was the plugin author who has nested the style into the body. I'll try to solve this and come back then.

  19. lxg
    Member
    Posted 8 years ago #


  20. lxg
    Member
    Posted 8 years ago #

    Alright, I rewrote the plugin a bit so that it produces valid output now (even XHTML 1.1 as far as I tested). The <style> now goes to the <head> using the wp_head hook. You can download this from my Website.

    My revision is not the claenest solution as the style is included into every page, not only the shop. But that doesn't hurt, except of a little overhead.

    I don't know if this solves your problem with the CSS. But if not, I guess you should take a look at the CSS float and clear directives, the are known not to work properly in all browsers, especially when nested to much. But this is far beyond WordPress, so you might want to (a) refer to a CSS forum on that and (b) do some cross browser testing, e.g. with Firefox or Opera.

  21. lxg
    Member
    Posted 8 years ago #


  22. simenfs
    Member
    Posted 8 years ago #

    Ok thanks alot :) Had a nice long saturday too, but didnæt go out untill later :P

    Thanks

  23. simenfs
    Member
    Posted 8 years ago #

    Heh, 15 seconds difference in posting :P I'll take a look at it now

    Thanks

  24. simenfs
    Member
    Posted 8 years ago #

    Hm. I tried your edited file, and I still have the problems. It still doesnt show norwegian letters and now the images doesnt show...

    Hmm, any clue what it might be?

    Thanks

  25. lxg
    Member
    Posted 8 years ago #

    Strange thing, I tested it myself (with your shop) and it worked fine. Especially the images leave me clueless.

    However, there might be problems because I saved it as ISO-8859-1. You can now download it as UTF-8. Please try it and tell me if it works. If it still doesn't work, maybe you could open it with your own editor and look if there are strange characters (apart from norwegian ;-)).

    Maybe you could -- if it still doesn't work -- tell me what exactly doesn't work. Also, some things about your server software and versions would be helpful. If your server runs Apache and you have access to your apache virtual host file and your php.ini file, please provide them, too. (You can also send me an e-mail to ag at zirona dot com).

  26. lxg
    Member
    Posted 8 years ago #


  27. simenfs
    Member
    Posted 8 years ago #

    Hiya. Thanks for helping out.

    It's still the same with the utf8 file. The pictures doesnt show and are not clickable.

    If you could tell me how to find my php.ini. Says its in /usr/local/Zend/etc/php.ini, but I can't find it in my ftp. Prolly not there I should look tho...But do you need the PHP Info? Configure Commands and some more stuff.

    Operating system : Debian GNU/Linux
    Perl Modules : Click to View (NOTE: this page is over 450 KB)
    Perl version : v5.8.4
    Perl path : /usr/bin/perl
    Sendmail path : /usr/sbin/sendmail
    MySQL version : 4.1.11-Debian_4sarge2-log
    PHP version : 4.3.10-16
    PHP Info : Click to View
    Physical IP address : **********
    Mysql host : supremecenter19.com
    Mysql port : 3306
    POP3/IMAP (incoming mail server) : mail.supremecenter19.com
    POP3 port : 110
    IMAP port : 443
    SMTP (outgoing mail server) : mail.supremecenter19.com
    SMTP port : 25

    Thanks for any help.

    Btw, could you check my shop at
    http://www.vsffc.com/?page_id=20 and tell me if it works allright for you? Might just be my browser (Moz. Firefox)

    EDIT: Hm, now the pictures show, no idea why. But the pictures still float over the div. Maybe the images isn't inside the div. Seems only the description text is. All I know is it's acting weird. :P

  28. lxg
    Member
    Posted 8 years ago #

    Your site looks pretty ok to me. I'm using Konqueror and FF, too.

    Yeah, the images float over the div because of the CSS float and clear. As soon as you use float block level elements are going to overlap. You need to do a lot of balancing out with margin, padding and so on, and you need to test across different browsers. That's what the fine art of CSS is all about. But as I said above, this ought not to be discussed at a WordPress forum. ;-)

    Btw, try removing the CSS for the shop on the Spreadshop options page (but save it somewhere else). You'll be seeing that now everything is in one column. So you'll need to play around with that chunk of CSS to optimize your shop.

  29. lxg
    Member
    Posted 8 years ago #


  30. simenfs
    Member
    Posted 8 years ago #

    Ok, thanks. I'll just copy the CSS over to the wp css file. Easier to have it all in one place. At the moment I'll stick with just making the description text alittle longer, then it doesn't seem like the image float over the div. One question tho, do you see � on the page, or is it gone or just me? If you also see it, I'll just use capitol letters instead. No big deal actually :)

    Thanks alot for your help mate, been a God.
    Simenfs

Topic Closed

This topic has been closed to new replies.

About this Topic