标签

2016年9月27日星期二

Drupal 7 show google DOC

Drupal 7 show google DOC

Try some google documents modules to show Google documents in Drupal, but they don't work.

This is a simple way to show types google documents in Drupal 7 web site, we don't need two much modules or code to finish it, I write this because I forgot why I can do it before, take sometime I find the solution:
this is running in Drupal 7.50 core version


  1. install a module: (https://www.drupal.org/project/custom_formatters) custom_formatters
    the current version:custom_formatters-7.x-2.4.zip(this is for windows Drupal7)
  2. install another module:Token (token),this is not require by custom_formatters module installation, but the configuration in custom_formatters depend on this module.
    (https://www.drupal.org/project/token) 
    https://ftp.drupal.org/files/projects/token-7.x-1.6.zip
  3. in the custom_fomatters module list, configuration(also you can find this configuration in structure/formatters)
  4. add a new formatter settings, use this code:
    <iframe width="[node:field_doc_width]" height="[node:field_doc_hight]" src="https://docs.google.com/file/d/[node:field_google_document_id]/preview"></iframe>
    you can use title: google-doc, format:HTML+Tokens
  5. update or add a new content type, include 3 fields with the name in the No.4 code
    field_doc_width /int
    field_doc_high /int
    field_google_document_id /text
  6. in the content type edit menu, display manage, the field_google_document_id format change to the custom format just create: google-doc
  7. add a new content in this content type, put the google article id (example:0B5F_qaK8bYV3bGNFd1pOYXJmbVU)in field_google_document_id, input width and hight and it works.

windows 10 can't boot, partition type, sata mode, repair tools version

I don't really understand the new GPT, WINDOWS 10, 8, UEFI, they come new with new hardware, but they made some problem for my PCs, I found google search can't give good solution to usually users, I try write this article to help anyone(myself) to deal with your situation, I can't give your a one by one step solution, but give you some idea to help you think about you situation.

two of my computer can't boot recently, I viewed this article give me some understanding,
An operating system wasn’t found” error  when booting Windows
https://support.microsoft.com/en-us/kb/3103656

but this article make a simple mistake in this command:
bcdboot c:\Windows /l en-us /s m: /f UEFI

before this command, another command is

assign letter=r:  (in diskpart command status)

so the m: should be r:

bcdboot c:\Windows /l en-us /s r: /f UEFI

otherwise you can't successfully to follow this article.
My PC's problem is not same with this article, but it give me some ideas.

so if someone you can't boot you PC after you install Win8 or Win 10, try to check your situation in following items:

1 what your BIOS is,  the key part is SATA boot MODE: UEFI OR UEFI+LEGACY 
  another SATA MODE IDE /AHCI
2 what you hard driver is, the newer SATA OR Legacy 80G SATA
3 How many HDs you mixed in you PCs, in my situation, I test use few disks, so I should really care for what disk be used to boot, what type SATA MODE should be setup
4 what OS you just install, Win 7, Win 8, Win 10? I use a Win PE 5.1 to repair the boot following that article mentioned before, the BCD file size is different, so I believe PE 5.1 is come from Win 8, but my OS in PC is Win 10, so my situation is not same with this article. actually, here is two thing you should think about, what type your OS is, what type is you repair WinPE is, maybe you use not Win PE, but care for this, it make different boot file, Win 8 Boot maybe not works in Win 10 PC
5 what disk partition type is, GPT or MBR

I don't make more explaining, I show my situation to help you deal with your situation:
I use a old 80G SATA to install a new Win 10 in my more power PC, the first mistake I didn't unplug another disk with windows 2003, this lead my all documents file in win2003 disappeared, why Microsoft is always make mistake to users? 
I should remember:
Backup is the first thing when you try some new thing that come from Microsoft, the new thing  just can come from God.
The new Win 10 can't boot when few days when I adjust the boot order, right now I know the problem is I should setup the SATA MODE in UEFI, because my old SATA 80 G in GPT partition model, I think this should be new tech following another new tech, the solution just setup the SATA MODE to UEFI is enough, but I believed the old SATA has some boot file problem, so I following the article to rebuild the BCD file, that make another mistake.

Finally I found the problem is not BCD file, I just delete the new BCD, rename the BCD.BAK to BCD,  after the SATA MODE is UEFI, it boot again.
Again, when you have problem in boot you PC after you new installation OS, check the following item:
BIOS SATA MODE: UEFI IDE AHCI LEGACY
HARD DRIVE PARTITION MODE: GPT MBR
OS TYPE: WIN 7, WIN 8, WIN10
REPAIR BOOT CD type: win PE5.1 win pe 10...
usually like this:
if you boot to old OS like windows xp, you sata should be IDE or legacy
if you boot to new win 10, you hd should be in GPT and you SATA should be in AHCI or UEFI
don't busy to repair your system, try to modify bios first