Problems, need help? Have a tip or advice? Post it here.
11 posts Page 1 of 2
Hello,

I'm very new to using Couch and I'm not really grasping the concept of how it relates or doesn't relate with HTML. When I view the source for my webpage it is in HTML with couch tags in it, but I can't find any html files that I can edit.

My end goal is to add 'print' to the media type to make it more printer-friendly if that helps.

Thanks! And let me know if you need more information!

Landon
Hi Landon,
When I view the source for my webpage it is in HTML with couch tags in..

Not sure which source you mean - is it the view:source we do in a browser for rendered pages or is it the PHP template on the server?

If it is the source seen in the browser, that certainly should never show any Couch tags. If it does, it can only mean that either you have not changed the extension of your template to '.php' or have failed to put in the <?php require_once( 'couch/cms.php' ); ?> and <?php COUCH::invoke(); ?> statements within it.

If, however, you mean the source contained in the PHP template itself, then that is the file that you your looking for to edit. All the HTML for the page should be in the template (or embedded in it via snippets).
You can put the CSS declaration for the print media in there.

Of course, I have been making assumptions of what you meant and could be completely off the mark.
Please post in the template you are trying to work on and maybe that would throw more light on the problem.

Thanks.
My Apologies!

I was viewing the page source from the browser and this does not have any couch tags in it. Sorry for the confusion! Is there a way to designate the media type for 'screen, print' in a php file? That is the only way I know how to make sure the page keeps its formatting in html and I don't see a place to do that in the php file.

Really the end result is to make sure the page doesn't lose its css formatting for printing.

Thanks for your help!

Landon
Hi,
Sorry for the delay in reply but I seem to have missed your response.
As for your query - could you please attach the PHP template you are trying to modify?

Thanks
Code: Select all
<?php require_once( 'couch/cms.php' ); ?>
<cms:template title='Donors' clonable='1' order='6'>
    <cms:editable name='link' label='Link' type='text' order='1' />
    <cms:editable name='logo' label='Logo' type='image' width='146' crop='1' quality='60' show_preview='1' order='2' />
    <cms:editable name='level' label='Donation Level' opt_values='25,000 or more=5 | 10,000-24,999=4 | 5,000-9,999=3 | 2,500-4,999=2 | 1,000-2,499=1 | 500-999=0' type='dropdown' />
    <cms:editable name='promote' label='Show on Homepage' opt_values='No=false | Yes=true' opt_selected='false' type='radio' order='3' />
    <cms:editable name='logo_footer' label='Logo (Homepage Footer)' type='image' show_preview='1' order='4' />
</cms:template>
<cms:if k_is_page>
<!DOCTYPE HTML>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <title>Donor Preview: <cms:get_custom_field 'site_name' masterpage='globals.php' /></title>
    <cms:embed 'css-js.html' />


Like I said I'm a bit new to Couch and Web Design, but I hope this helps. Let me know if you need anything else.
Unless there is something else in the <head>...</head> relevant to your query which you have not posted, you are probably going to want to edit the code in the css-js.html snippets file. Unless you have changed the snippets directory, this file should be located in the snippets folder of your couch installation. Please post the contents of css-js.html if you are not certain what to change based on my previous post at viewtopic.php?p=11042#p11042.
Thank you very much KK and cheesypoof! I see the file and tag that I need to edit now. Currently I don't have the authority to access the server that we run on, but I will ask someone to test it. Thanks again!
I tried adding 'print' to the media type in the css-js.html file and didn't have much luck.

Unfortunately I did forget a tag that was in the <head> section. Here it is.

Code: Select all
<link href="css/print.css" rel="stylesheet" type="text/css">


Can I add 'media = screen,print' to the end of this tag instead? Thanks.
Nevermind. I guess I actually added the code from above to the file myself. Thanks anyways.
Sorry to make someone revisit this problem, but I still can't find a solution. I have the PHP file for a webpage and I want to change the media to 'screen, print' to help the page keep its formatting when it is printed. Here is some relevant code in the php file:
Code: Select all
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <title>Donor Preview: <cms:get_custom_field 'site_name' masterpage='globals.php' /></title>
    <cms:embed 'css-js.html' />
</head>


So I was told to edit the css-js.html file in the snippets folder. The original relevant code in this file is
Code: Select all
<link href="<cms:show k_site_link />css/t2/import.css" rel="stylesheet" type="text/css" media="screen" />
<link href="<cms:show k_site_link />css/print.css" rel="stylesheet" type="text/css" media="print" />


So I changed the first link to media = 'screen,print' but nothing happened to the page when printed. Does anyone have any other ideas? Any idea helps at this point. Thank you very much.
11 posts Page 1 of 2
cron