<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>&#8235;המכללה &#187; נגישות&#8236;</title>	<atom:link href="http://n2b.org/tag/%d7%a0%d7%92%d7%99%d7%a9%d7%95%d7%aa/feed" rel="self" type="application/rss+xml" />
	<link>http://n2b.org</link>
	<description>&#8235;כי החיים זה לא מדע מדוייק&#8236;</description>	<lastBuildDate>Sat, 04 Sep 2010 20:32:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>&#8235;התאמת הפוסט להדפסה&#8236;</title>		<link>http://n2b.org/archives/1159</link>
		<comments>http://n2b.org/archives/1159#comments</comments>
		<pubDate>Tue, 24 Feb 2009 15:21:08 +0000</pubDate>
		<dc:creator>&#8235;~ניצן~&#8236;</dc:creator>				<category><![CDATA[וורדפרס]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[נגישות]]></category>
		<category><![CDATA[עיצוב]]></category>
		<category><![CDATA[הדפסה]]></category>

		<guid isPermaLink="false">http://n2b.org/?p=1159</guid>
		<description><![CDATA[&#8235;פעם בכמה זמן אני מוצא את עצמי נאלץ להדפיס פוסט מבלוג כלשהו. לפעמים כי אני לוקח אותו כחומר קריאה למקום שאליו אני לא לוקח לפטופ, לפעמים כי עשיתי שינוי כזה או אחר בקבצי ההגדרות ועכשיו המחשב שלי עובד במוד טקסטואלי בלבד &#8211; כך או כך &#8211; לפעמים אני צריך להדפיס וקרוב לוודאי שאני לא היחיד. [...]&#8236;]]></description>			<content:encoded><![CDATA[<div dir="rtl"><p>פעם בכמה זמן אני מוצא את עצמי נאלץ להדפיס פוסט מבלוג כלשהו. לפעמים כי אני לוקח אותו כחומר קריאה למקום שאליו אני לא לוקח לפטופ, לפעמים כי עשיתי שינוי כזה או אחר בקבצי ההגדרות ועכשיו המחשב שלי עובד במוד טקסטואלי בלבד &#8211; כך או כך &#8211; לפעמים אני צריך להדפיס וקרוב לוודאי שאני לא היחיד.<br />
מי שטורח להיכנס אל הבלוג שלי ולא קורא אותי רק דרך RSS בוודאי שם לב למבנה העיצובי שלי &#8211; הדר ופוטר ענקיים, שני ברי ניווט עתירי פיצ'רים ולינקים, הרבה מקום לתגובות ובתוך כל זה &#8211; מתחבא הפוסט. התוצאה מכך היא שכאשר רוצים להדפיס פוסט מתלווה אליו כל החלק ההיקפי שהופך עמוד אחד של תוכן לכ 7-10 דפים מודפסים. האם באמת יש צורך בכל כמות הנייר הזו? תוכן של פוסט שלי ימלא בין עמוד אחד לשניים, כל השאר אין לו חשיבות בהדפסה. </p>
<p>היות והבלוגים מבוססי וורדפרס בנויים בעזרת Xhtml ו css קל מאוד להתאים את העיצוב להדפסה, כל מה שצריך זה ליצור כללים מתאימים לגירסת הדפסה שיציגו רק את התוכן הרלוונטי. השינוי וההתאמה הללו מצריכים לא מעט עבודה ומעברים על הקוד, מי שיש לו Firebug ישמח, מי שאין לו <a href="http://getfirebug.com/">שיתקין</a>, דבר נוסף שכדאי שיהיה לכם זה גם שרת ניסוי / בדיקות, <a href="http://www.apachefriends.org/en/xampp.html">Xampp</a> יעשה עבודה מצויינת למי שעובד תחת חלונות ולא רוצה להסתבך עם התקנות. </p>
<p><strong>שלב ראשון: מציאת המבנה</strong></p>
<p>היות והמבנה שלי הוא קצת מבולגן ולא דומה לרוב הבלוגים, אתמקד במבנה בסיסי יותר של תבנית עיצוב &#8211; כזו שיש לה הדר, בר ניווט עילי, בר ניווט צידי, איזור תוכן ופוטר. קובריק פחות או יותר מתאימה פה אם כי במקרה שלה אין בר ניווט עליון. זהו מבנה השלד ה Xhtmlי של התבנית לגמרי לא התיחסתי פה לשלל סלקטורים קטנים שיושבים בתוך איזור הפוסט (למשל אזור המטא של הפוסט) אלא רק לשלד הגדול. שמרתי על מבנה מקונן כדי להקל על ההבנה:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">&lt;body&gt;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &lt;div id=&quot;page&quot;&gt;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;div id=&quot;header&quot;&gt;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/div&gt;
</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;div id=&quot;navbar&quot;&gt;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/div&gt;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;div id=&quot;wrapper&quot;&gt;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;div id=&quot;sidebar&quot;&gt;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/div&gt;
</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;div id=&quot;content&quot;&gt;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;div id=&quot;post-38&quot; class=&quot;post&quot;&gt;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/div&gt;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;div id=&quot;respond&quot;&gt;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/div&gt;
</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/div&gt;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/div&gt;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;div id=&quot;footer&quot;&gt;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/div&gt;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &lt;/div&gt;
</div>
</li>
<li class="li2">
<div class="de2">&lt;/body&gt;</div>
</li>
</ol>
</div>
<p><strong>שלב שני: עריכת CSS</strong></p>
<p>ראשית, יש לפתוח את קובץ ה CSS של הערכה (הקובץ style.css) לגלול אל תחתיתו ולהוסיף בו את השורות הללו:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="co1">@media print {</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
<p>יצרנו למעשה תת מחלקה בקובץ ה CSS שאומרת לדפדפן כיצד להתנהג כשאנחנו רוצים להדפיס את העמוד. משלד ה Xhtml אפשר לראות יחסית בקלות שאיזור הפוסט נמצא תחת content וזהו למעשה האיזור היחיד שאנחנו רוצים להדפיס, כל השאר &#8211; ההדר, ברי הניווט או הפוטר מיותרים לחלוטין. לכן, כל אובייקט שאנחנו לא רוצים שיוצג נשתמש עבורו ב display:none. זה גם הזמן לשחק עם הקרע, צבעי הפונטים ורוחב העמודה על מנת לוודא שהתוכן יודפס למלוא רוחב העמוד. </p>
<p>כך זה יכול להראות בסוף:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1"><span class="co1">@media print {</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re0">#body</span> <span class="br0">&#123;</span> background<span class="re2">:white</span>; color<span class="re2">:black</span>; margin<span class="re2">:<span class="nu0">0</span></span>; &nbsp;direction<span class="re2">:rtl</span>; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re0">#page</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re0">#header</span> <span class="br0">&#123;</span>display<span class="re2">:none</span> <span class="br0">&#125;</span></div>
</li>
<li class="li2">
<div class="de2"><span class="re0">#navbar</span> <span class="br0">&#123;</span>display<span class="re2">:none</span> <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re0">#sidebar</span> <span class="br0">&#123;</span>display<span class="re2">:none</span> <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re0">#content</span> <span class="br0">&#123;</span><span class="kw1">width</span>: <span class="re3"><span class="nu0">100</span>%</span><span class="br0">&#125;</span>&nbsp; </div>
</li>
<li class="li1">
<div class="de1"><span class="re0">#respond</span> <span class="br0">&#123;</span>display<span class="re2">:none</span> <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re0">#footer</span> <span class="br0">&#123;</span>display<span class="re2">:none</span> <span class="br0">&#125;</span></div>
</li>
<li class="li2">
<div class="de2"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
<p>אפשר לראות שבשורה 7 שיניתי את רוחב העמודה ל 100% ולא קבעתי מספר פיקסלים סופי, זה נעשה על מנת להבטיח התאמה מלאה לרוחב העמוד ללא קשר לרוחב הדף עליו מדפיס המשתמש.</p>
<p><strong>שלב שלישי: אקטיבציה</strong></p>
<p>כל שיש לעשות עכשיו זה לרענן את קריאת ה CSS כך שיודיע לדפדפן להתיחס לקובץ גם במקרה של הדפסה, חפשו בקוד המקור שלכם (קרוב לוודאי בקובץ header.php) את השורה הזו:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">&lt;link rel=<span class="st0">&quot;stylesheet&quot;</span> href=<span class="st0">&quot;&lt;?php bloginfo('stylesheet_url'); ?&gt;&quot;</span> type=<span class="st0">&quot;text/css&quot;</span> media=<span class="st0">&quot;screen&quot;</span> /&gt;&lt;/link&gt;</div>
</li>
</ol>
</div>
<p>ושנו אותה כדי שתראה כך:</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">&lt;link rel=<span class="st0">&quot;stylesheet&quot;</span> href=<span class="st0">&quot;&lt;?php bloginfo('stylesheet_url'); ?&gt;&quot;</span> type=<span class="st0">&quot;text/css&quot;</span> media=<span class="st0">&quot;screen, &nbsp;print&quot;</span> /&gt;&lt;/link&gt;</div>
</li>
</ol>
</div>
<p>התוספת היא למעשה רק המילה print תחת סוג המדיה, אבל מעכשיו הדפדפן ידע כיצד לפרמט את עמודי הפוסטים שלכם להדפסה. </p>
<p><strong>מה הלאה</strong></p>
<p>הפוסט הזה מתיחס רק להדפסה של עמודי פוסטים, למרות שאם הקפדתם על מבנה ה Xhtml של הבלוג לכל סוגי הדפים ההגדרה צריכה לחול גם עליהם. אפשר עכשיו לעבור על הדפים האחרים בבלוג (ראשי, עמוד, ארכיון, תוצאות חיפוש, קטגוריה וכ') ולראות האם הם מודפסים לשביעות רצונכם או לא. את כל התיקונים אפשר להוסיף למחלקה שיצרנו ולהבטיח תוצאות הדפסה טובות בכל עמוד.</p>
<p>סוג מדיה אחר ששווה להכיר הוא handheld והוא מיועד לתצוגה על גבי מחשבי כף יד ומכשירי סלולר &#8211; ומאפשר לעשות גירסה קלה ונוחה יותר של הבלוג שלכם כך שתתאים לסלולר. לרוע המזל בגלל המגוון במכשירים, גדלי מסכים ורזולוציות צריך להיזהר עד מאוד מקביעה של גדלים קבועים. עמודה שהרוחב שלה מוגדר כ 600px לא תעבוד טוב במכשיר שיש לו רק 200 פיקסלים בתצוגה. לכן, מומלץ להמיר את כל גדלי התיבות לרוחב יחסי וכך להתאים את התוכן לכל סוגי הניידים. </p>
</div>]]></content:encoded>			<wfw:commentRss>http://n2b.org/archives/1159/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>
